Keyboard shortcut Assign my self with confirm dialog

Felix Lilian Jung
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2018

Hi, is it possible to override the keyboard shortcuts in jira with something like

                    $( ".content" ).keydown(function( event ) {
                    if ( event.which == 79 ) {
                     event.preventDefault();
                     AJS.$('#Unassign').trigger("click")
                    }
                    if ( event.which == 73 ) {
                     event.preventDefault();
                     if (confirm("Soll der zugewiesene Benutzer überschrieben werden")) {
                         AJS.$('#Assign').trigger("click")
                     }
                    }

 

I've test it out but the shortcut's don't work. I can override it with

 

 onkeydown = onkeyup = function(e){
                        e = e || event; // to deal with IE
                        map[e.keyCode] = e.type == 'keydown';
                        if(map[18] && map[79]){
                            AJS.$('#Unassign').trigger("click")
                        }
                        if(e.keyCode == 73){
                            alert(map[73])
                               if (confirm("Soll der zugewiesene Benutzer überschrieben werden")) {
                                alert("assign")
                            }
                        }

 But then there fires on the whole site my confirm instead when i use the searchbar or input fields.

The

AJS.whenIType("i")

 i can't use because jira will nit override existing key codes. Is there a way to do that?

 

regards Torsten

0 answers

Suggest an answer

Log in or Sign up to answer