[Shortcut Keys Widget] Disable In Inputfields

[Shortcut Keys Widget] Disable In Inputfields

  
Forge Component
(8)
Published on 2012-03-12 by Rodrigo Castelo
8 votes
Published on 2012-03-12 by Rodrigo Castelo
Hi!

In the Include block I see this piece of code to disable the shortcut if the user is in a Inputfield:
 //The function to be called at keypress
        var func = function(e) {
            e = e || window.event;
            
            if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
                var element;
                if(e.target) element=e.target;
                else if(e.srcElement) element=e.srcElement;
                if(element.nodeType==3) element=element.parentNode;

                if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
            }
However it look like it's not working. When I use the demo page it also fails.

Kind Regards,
Martijn Habraken
Solution
In the top part of the code the
'disable_in_input'= false
So to let the code work you can change it in:
'disable_in_input'= true
Or you can call the add with the specific object.
Solution