Permalink
Browse files

Core: Don't create `$.support.selectstart`

  • Loading branch information...
scottgonzalez committed Apr 3, 2014
1 parent 0059722 commit d24cd35f0cf211a5fed379532f1d9c762f39b9e2
Showing with 9 additions and 5 deletions.
  1. +9 −5 ui/core.js
View
@@ -207,7 +207,6 @@ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
// deprecated
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
$.support.selectstart = "onselectstart" in document.createElement( "div" );
$.fn.extend({
focus: (function( orig ) {
return function( delay, fn ) {
@@ -225,12 +224,17 @@ $.fn.extend({
};
})( $.fn.focus ),
disableSelection: function() {
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
".ui-disableSelection", function( event ) {
disableSelection: (function() {
var eventType = "onselectstart" in document.createElement( "div" ) ?
"selectstart" :
"mousedown";
return function() {
return this.bind( eventType + ".ui-disableSelection", function( event ) {
event.preventDefault();
});
},
};
})(),
enableSelection: function() {
return this.unbind( ".ui-disableSelection" );

0 comments on commit d24cd35

Please sign in to comment.