Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3087 Zobrazení

I am trying set hotkey (ctrl + x) to focus input text but it doesn't work.
My code here:

<html>

<input id="text_input" type="search" class="form-control shadow-none" placeholder="Search...."
</input>

<JS>

    Widget.extend({
        template: 'systray_odoo_search.search_icon',           
        events: {
            'keydown': '_onKeydown_searchFocus',
            // 'show.bs.dropdown': '_onActivityMenuShow',
            // 'hide.bs.dropdown': '_onActivityMenuHide',
        },
    _onKeydown_searchFocus: function (e) {
            var self = this;
            if (e.ctrlKey && e.keyCode == 'X'.charCodeAt(0)) {
                self.$('#text_input').focus();
                e.preventDefault();
            }
        },

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
úno 18
3380
0
zář 17
4182
2
lis 15
692
1
úno 24
11981
0
bře 15
319