Ticket #656: _activeElement.patch
| File _activeElement.patch, 1.2 kB (added by mokhet, 6 years ago) |
|---|
-
htmlarea.js
2918 2918 * 2919 2919 * @returns null | element 2920 2920 */ 2921 HTMLArea.prototype._activeElement = function(sel)2921 if(HTMLArea.is_ie) 2922 2922 { 2923 if(sel == null) return null; 2924 if(this._selectionEmpty(sel)) return null; 2923 HTMLArea.prototype._activeElement = function(sel) 2924 { 2925 if(sel == null) return null; 2926 if(this._selectionEmpty(sel)) return null; 2925 2927 2926 if(HTMLArea.is_ie)2927 {2928 2928 if(sel.type.toLowerCase() == "control") 2929 2929 { 2930 2930 return sel.createRange().item(0); … … 2964 2964 */ 2965 2965 return null; 2966 2966 } 2967 } 2968 else 2967 2968 }; 2969 } else { 2970 HTMLArea.prototype._activeElement = function(sel) 2969 2971 { 2972 if(sel == null) return null; 2973 if(this._selectionEmpty(sel)) return null; 2974 2970 2975 // For Mozilla we just see if the selection is not collapsed (something is selected) 2971 2976 // and that the anchor (start of selection) is an element. This might not be totally 2972 2977 // correct, we possibly should do a simlar check to IE? … … 2986 2991 } 2987 2992 } 2988 2993 return null; 2989 } 2990 } ;2994 }; 2995 } 2991 2996 2992 2993 2997 HTMLArea.prototype._selectionEmpty = function(sel) 2994 2998 { 2995 2999 if(!sel) return true;
