corrade-http-templates – Blame information for rev 62

Subversion Repositories:
Rev:
Rev Author Line No. Line
62 office 1 /*!
2 * jQuery UI Disable Selection 1.12.1
3 * http://jqueryui.com
4 *
5 * Copyright jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
8 */
9  
10 //>>label: disableSelection
11 //>>group: Core
12 //>>description: Disable selection of text content within the set of matched elements.
13 //>>docs: http://api.jqueryui.com/disableSelection/
14  
15 // This file is deprecated
16 ( function( factory ) {
17 if ( typeof define === "function" && define.amd ) {
18  
19 // AMD. Register as an anonymous module.
20 define( [ "jquery", "./version" ], factory );
21 } else {
22  
23 // Browser globals
24 factory( jQuery );
25 }
26 } ( function( $ ) {
27  
28 return $.fn.extend( {
29 disableSelection: ( function() {
30 var eventType = "onselectstart" in document.createElement( "div" ) ?
31 "selectstart" :
32 "mousedown";
33  
34 return function() {
35 return this.on( eventType + ".ui-disableSelection", function( event ) {
36 event.preventDefault();
37 } );
38 };
39 } )(),
40  
41 enableSelection: function() {
42 return this.off( ".ui-disableSelection" );
43 }
44 } );
45  
46 } ) );