mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Core: Don't create $.support.selectstart
This commit is contained in:
parent
0059722b6b
commit
d24cd35f0c
14
ui/core.js
14
ui/core.js
@ -207,7 +207,6 @@ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
|
|||||||
// deprecated
|
// deprecated
|
||||||
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
||||||
|
|
||||||
$.support.selectstart = "onselectstart" in document.createElement( "div" );
|
|
||||||
$.fn.extend({
|
$.fn.extend({
|
||||||
focus: (function( orig ) {
|
focus: (function( orig ) {
|
||||||
return function( delay, fn ) {
|
return function( delay, fn ) {
|
||||||
@ -225,12 +224,17 @@ $.fn.extend({
|
|||||||
};
|
};
|
||||||
})( $.fn.focus ),
|
})( $.fn.focus ),
|
||||||
|
|
||||||
disableSelection: function() {
|
disableSelection: (function() {
|
||||||
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
var eventType = "onselectstart" in document.createElement( "div" ) ?
|
||||||
".ui-disableSelection", function( event ) {
|
"selectstart" :
|
||||||
|
"mousedown";
|
||||||
|
|
||||||
|
return function() {
|
||||||
|
return this.bind( eventType + ".ui-disableSelection", function( event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
},
|
};
|
||||||
|
})(),
|
||||||
|
|
||||||
enableSelection: function() {
|
enableSelection: function() {
|
||||||
return this.unbind( ".ui-disableSelection" );
|
return this.unbind( ".ui-disableSelection" );
|
||||||
|
Loading…
Reference in New Issue
Block a user