Skip to content

Instantly share code, notes, and snippets.

@Qard
Forked from fanuch/userscript.js
Created December 21, 2023 07:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qard/d46030496703d9ae0330adab8bee2c60 to your computer and use it in GitHub Desktop.
Save Qard/d46030496703d9ae0330adab8bee2c60 to your computer and use it in GitHub Desktop.
Block Click to Edit on Jira Issue
// ==UserScript==
// @name Disable Jira Click Edit
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disable click edit in Jira issue descriptions
// @author fanuch
// @match https://*.atlassian.net/browse/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net
// @grant none
// ==/UserScript==
(function() {
'use strict';
function addCustomEventListener(selector, event, handler) {
document.querySelector('body').addEventListener(event, (e) => {
let targetElement = e.target;
while (targetElement != null) {
if (targetElement.matches(selector)) return handler(e);
targetElement = targetElement.parentElement;
}
}, true);
}
addCustomEventListener('.ak-renderer-document', 'click', (e) => {
e.stopPropagation();
console.log('Blocked click-edit of Jira issue description. You\'re welcome.');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment