Created
November 2, 2023 21:51
-
-
Save soar/e9b38726e2bd32e644d16b33a4735ae3 to your computer and use it in GitHub Desktop.
Disable Jira Edit-On-Click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disable Jira Edit-On-Click | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Disable click edit in Jira issue descriptions | |
// @match https://*.atlassian.net/browse/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener('click', ((event) => { | |
if (event.metaKey || event.ctrlKey) { | |
return; | |
} | |
var e = event.target; | |
if (e.tagName == 'A') { | |
return; | |
} | |
while (e != document) { | |
var aa = e.attributes; | |
for (var i = 0; i < aa.length; ++i) { | |
var a = aa[i]; | |
if (a.name == 'role' && a.value == 'presentation' && e.tagName != 'SPAN') { | |
console.log("Not opening editor, hold ctrl/cmd to open editor"); | |
event.preventDefault(); | |
event.stopPropagation(); | |
return false; | |
}; | |
} | |
e = e.parentNode; | |
} | |
}), { capture: true }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment