Changeset 2d4173 in indico


Ignore:
Timestamp:
12/01/11 13:38:15 (18 months ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 4c7d4152dff271ba5df5a8606605969cab454080
Children:
8f8e4d
Parents:
d8c61c
git-author:
Adrian Moennich <jerome.ernst.monnich@…> (07/11/11 17:34:30)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (12/01/11 13:38:15)
Message:

[IMP] Allow closing the dialog using escape

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/htdocs/js/indico/Core/Dialogs/Popup.js

    ra119d0 r2d4173  
    9797                modal: true, 
    9898                resizable: false, 
    99                 closeOnEscape: false, 
     99                closeOnEscape: true, 
    100100                title: this.title, 
    101101                minWidth: '250px', 
     
    116116        // Close button clicked 
    117117        if(e.originalEvent && $(e.originalEvent.currentTarget).hasClass('ui-dialog-titlebar-close')) { 
     118            if(isFunction(this.closeHandler) && !this.closeHandler()) { 
     119                return false; 
     120            } 
     121        } 
     122        // Escape key 
     123        else if(e.keyCode && e.keyCode === $.ui.keyCode.ESCAPE) { 
     124            e.stopPropagation(); // otherwise this triggers twice for some reason 
     125            if(this.closeHandler === null || !this.showCloseButton) { 
     126                // Ignore escape if we don't have a close button 
     127                return false; 
     128            } 
    118129            if(isFunction(this.closeHandler) && !this.closeHandler()) { 
    119130                return false; 
Note: See TracChangeset for help on using the changeset viewer.