Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

50 righe
1.1 KiB

  1. /*!
  2. * jQuery UI Disable Selection 1.13.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. //>>label: disableSelection
  10. //>>group: Core
  11. //>>description: Disable selection of text content within the set of matched elements.
  12. //>>docs: http://api.jqueryui.com/disableSelection/
  13. // This file is deprecated
  14. ( function( factory ) {
  15. "use strict";
  16. if ( typeof define === "function" && define.amd ) {
  17. // AMD. Register as an anonymous module.
  18. define( [ "jquery", "./version" ], factory );
  19. } else {
  20. // Browser globals
  21. factory( jQuery );
  22. }
  23. } )( function( $ ) {
  24. "use strict";
  25. return $.fn.extend( {
  26. disableSelection: ( function() {
  27. var eventType = "onselectstart" in document.createElement( "div" ) ?
  28. "selectstart" :
  29. "mousedown";
  30. return function() {
  31. return this.on( eventType + ".ui-disableSelection", function( event ) {
  32. event.preventDefault();
  33. } );
  34. };
  35. } )(),
  36. enableSelection: function() {
  37. return this.off( ".ui-disableSelection" );
  38. }
  39. } );
  40. } );