diff options
Diffstat (limited to 'ui/widgets/selectmenu.js')
-rw-r--r-- | ui/widgets/selectmenu.js | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/ui/widgets/selectmenu.js b/ui/widgets/selectmenu.js index b1e2033ba..eecd368f5 100644 --- a/ui/widgets/selectmenu.js +++ b/ui/widgets/selectmenu.js @@ -167,12 +167,6 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { role: "listbox", select: function( event, ui ) { event.preventDefault(); - - // Support: IE8 - // If the item was selected via a click, the text selection - // will be destroyed in IE - that._setSelection(); - that._select( ui.item.data( "ui-selectmenu-item" ), event ); }, focus: function( event, ui ) { @@ -409,20 +403,9 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { return; } - if ( window.getSelection ) { - selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange( this.range ); - - // Support: IE8 - } else { - this.range.select(); - } - - // Support: IE - // Setting the text selection kills the button focus in IE, but - // restoring the focus doesn't kill the selection. - this.button.trigger( "focus" ); + selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange( this.range ); }, _documentClick: { @@ -442,17 +425,9 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { // Prevent text selection from being reset when interacting with the selectmenu (#10144) mousedown: function() { - var selection; - - if ( window.getSelection ) { - selection = window.getSelection(); - if ( selection.rangeCount ) { - this.range = selection.getRangeAt( 0 ); - } - - // Support: IE8 - } else { - this.range = document.selection.createRange(); + var selection = window.getSelection(); + if ( selection.rangeCount ) { + this.range = selection.getRangeAt( 0 ); } }, @@ -643,11 +618,7 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { _resizeMenu: function() { this.menu.outerWidth( Math.max( this.button.outerWidth(), - - // Support: IE10 - // IE10 wraps long text (possibly a rounding bug) - // so we add 1px to avoid the wrapping - this.menu.width( "" ).outerWidth() + 1 + this.menu.width( "" ).outerWidth() ) ); }, |