Skip to content

Instantly share code, notes, and snippets.

@soar
Created November 2, 2023 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soar/e9b38726e2bd32e644d16b33a4735ae3 to your computer and use it in GitHub Desktop.
Save soar/e9b38726e2bd32e644d16b33a4735ae3 to your computer and use it in GitHub Desktop.
Disable Jira Edit-On-Click
// ==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