mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
parent
f0260fd91b
commit
4916487440
22
ui/core.js
22
ui/core.js
@ -21,7 +21,9 @@
|
|||||||
define( [
|
define( [
|
||||||
"jquery",
|
"jquery",
|
||||||
"./data",
|
"./data",
|
||||||
"./version" ], factory );
|
"./disable-selection",
|
||||||
|
"./version"
|
||||||
|
], factory );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Browser globals
|
// Browser globals
|
||||||
@ -284,24 +286,6 @@ if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
|
|||||||
// deprecated
|
// deprecated
|
||||||
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
||||||
|
|
||||||
$.fn.extend( {
|
|
||||||
disableSelection: ( function() {
|
|
||||||
var eventType = "onselectstart" in document.createElement( "div" ) ?
|
|
||||||
"selectstart" :
|
|
||||||
"mousedown";
|
|
||||||
|
|
||||||
return function() {
|
|
||||||
return this.on( eventType + ".ui-disableSelection", function( event ) {
|
|
||||||
event.preventDefault();
|
|
||||||
} );
|
|
||||||
};
|
|
||||||
} )(),
|
|
||||||
|
|
||||||
enableSelection: function() {
|
|
||||||
return this.off( ".ui-disableSelection" );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
|
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
|
||||||
$.ui.plugin = {
|
$.ui.plugin = {
|
||||||
add: function( module, option, set ) {
|
add: function( module, option, set ) {
|
||||||
|
46
ui/disable-selection.js
Normal file
46
ui/disable-selection.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*!
|
||||||
|
* jQuery UI Disable Selection @VERSION
|
||||||
|
* http://jqueryui.com
|
||||||
|
*
|
||||||
|
* Copyright jQuery Foundation and other contributors
|
||||||
|
* Released under the MIT license.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
//>>label: disableSelection
|
||||||
|
//>>group: Core
|
||||||
|
//>>description: Disable selection of text content within the set of matched elements.
|
||||||
|
//>>docs: http://api.jqueryui.com/disableSelection/
|
||||||
|
|
||||||
|
// This file is deprecated
|
||||||
|
( function( factory ) {
|
||||||
|
if ( typeof define === "function" && define.amd ) {
|
||||||
|
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define( [ "jquery", "./version" ], factory );
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Browser globals
|
||||||
|
factory( jQuery );
|
||||||
|
}
|
||||||
|
} ( function( $ ) {
|
||||||
|
|
||||||
|
return $.fn.extend( {
|
||||||
|
disableSelection: ( function() {
|
||||||
|
var eventType = "onselectstart" in document.createElement( "div" ) ?
|
||||||
|
"selectstart" :
|
||||||
|
"mousedown";
|
||||||
|
|
||||||
|
return function() {
|
||||||
|
return this.on( eventType + ".ui-disableSelection", function( event ) {
|
||||||
|
event.preventDefault();
|
||||||
|
} );
|
||||||
|
};
|
||||||
|
} )(),
|
||||||
|
|
||||||
|
enableSelection: function() {
|
||||||
|
return this.off( ".ui-disableSelection" );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
} ) );
|
@ -23,8 +23,9 @@
|
|||||||
define([
|
define([
|
||||||
"jquery",
|
"jquery",
|
||||||
"./core",
|
"./core",
|
||||||
"./version",
|
"./disable-selection",
|
||||||
"./mouse",
|
"./mouse",
|
||||||
|
"./version",
|
||||||
"./widget"
|
"./widget"
|
||||||
], factory );
|
], factory );
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user