Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to temporarily disable some shortcut keys in Jira using AUI

3layer (expert) May 22, 2012

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Séb P.
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2013

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

TAGS
AUG Leaders

Atlassian Community Events