How to temporarily disable some shortcut keys in Jira using AUI

Hello everybody,

I would like to temporarily disable some shortcut keys in Jira using the AUI library.

In my specific case, I would like to disable the "m" key (comment issue) in some workflow steps.

I tried this without success:

if (AJS.$("#status-val").text().trim() == "blablabla") {
  //alert("Blocking comments...");
  AJS.$("#comment-issue").hide(); //OK
  AJS.$("#footer-comment-button").hide(); //OK
  AJS.whenIType("m").execute(function(){}); //NOK, the "m" key continues reacting to the comment operation
}

Also, I installed and tried without success the JS Shortcut Library plugin (http://www.stepanreznikov.com/js-shortcuts/):

<script type="text/javascript" src="/jira/includes/js/plugins/js-shortcuts/jquery.shortcuts.min.js"></script>

if (AJS.$("#status-val").text().trim() == "blablabla") {
  //alert("Blocking comments...");
  AJS.$("#comment-issue").hide(); //OK
  AJS.$("#footer-comment-button").hide(); //OK
  AJS.$.Shortcuts.remove({type: 'hold',mask: 'm'}); //NOK, the "m" key continues reacting to the comment operation
}

So, why the right way to acomplish this issue?

1 answer

Did you try with the last Jira? This seems to work fine now (Jira 6.0.6)!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Agile

How Scrum works? It starts with training and education

To answer “How scrum works,” most of the teams I've worked with first addressed the question: “where to start?”  That question applies to both implementation and improvements on the Scrum framew...

180 views 3 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you