Changeset 1385


Ignore:
Timestamp:
02/08/18 10:49:17 (10 months ago)
Author:
gogo
Message:

Fix for FancySelects? with IE11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/FancySelects/FancySelects.js

    r1384 r1385  
    120120    } 
    121121     
     122    jQuery(e).on('select2:opening', function(){ 
     123      // IE11 needs this because opening the select2 de-selects the selected text 
     124      // so if we don't save and restore it nothing happens (except that the text is deselected) 
     125      // FF, Chrome and Edge are fine without this, but they also don't seem to care with it 
     126      // so I guess just do it across the board is safe enough 
     127      el._FancySelects_SavedSelection = editor.saveSelection(); 
     128    }); 
     129     
    122130    jQuery(e).on('select2:select', function(){ 
     131      if(el._FancySelects_SavedSelection)  
     132      { 
     133        editor.restoreSelection(el._FancySelects_SavedSelection); 
     134      } 
     135      el._FancySelects_SavedSelection = null; 
    123136      editor._comboSelected(el, txt); 
    124137    }); 
     
    130143{ 
    131144    var editor = this; 
     145     
    132146    jQuery('.toolbarElement select').each(function(i,e){ 
    133        
    134       if(e.name.match(/CSS-class/)) 
    135       { 
    136          
    137       } 
    138        
    139147      jQuery(e).trigger('change'); 
    140148    }); 
     149     
    141150}; 
Note: See TracChangeset for help on using the changeset viewer.