[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 

Changeset 14530


Ignore:
Timestamp:
10/08/18 11:10:23 (7 months ago)
Author:
tbishop
Message:

cldrbug 11265: fix isInputBusy to prevent unintended disappearance of little input window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/cldr-apps/WebContent/js/survey.js

    r14470 r14530  
    591591 
    592592/** 
    593  * Is the keyboard 'busy'? i.e., it's a bad time to change the DOM 
     593 * Is the keyboard or input widget 'busy'? i.e., it's a bad time to change the DOM 
     594 * 
    594595 * @method isInputBusy 
     596 * @return true if window.getSelection().anchorNode.className contains "dijitInp" or "popover-content", 
     597 *         else false 
     598 * 
     599 * "popover-content" identifies the little input window, created using bootstrap, that appears when the 
     600 * user clicks an add ("+") button. Added "popover-content" per https://unicode.org/cldr/trac/ticket/11265. 
     601 * 
     602 * TODO: clarify dependence on "dijitInp"; is that still used here, and if so, when? 
     603 * Add automated regression testing to anticipate future changes to bootstrap/dojo/dijit/etc. 
    595604 */ 
    596605function isInputBusy() { 
    597         if(!window.getSelection) return false; 
     606        if (!window.getSelection) { 
     607                return false; 
     608        } 
    598609        var sel = window.getSelection(); 
    599         if(sel && sel.anchorNode && sel.anchorNode.className && sel.anchorNode.className.indexOf("dijitInp")!=-1) { 
    600                 return true; 
     610        if (sel && sel.anchorNode && sel.anchorNode.className) { 
     611                if (sel.anchorNode.className.indexOf("dijitInp") != -1) { 
     612                        return true; 
     613                } 
     614                if (sel.anchorNode.className.indexOf("popover-content") != -1) { 
     615                        return true; 
     616                } 
    601617        } 
    602618        return false; 
Note: See TracChangeset for help on using the changeset viewer.