diff options
author | Felix Nagel <info@felixnagel.com> | 2012-05-31 18:43:42 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-05-31 18:43:42 +0200 |
commit | 749c8fbb6673a15c6477b43d6a6a4f7101f85a5b (patch) | |
tree | e10cd0ba0124f646d568e1dea5aa177d14f949cc /ui/jquery.ui.core.js | |
parent | 8abe1d015f5b8d1aa68ccc9dd1ad4744b0216938 (diff) | |
parent | e0fe788ee0c0c0d8d23f9d90b9acff713ba1302f (diff) | |
download | jquery-ui-749c8fbb6673a15c6477b43d6a6a4f7101f85a5b.tar.gz jquery-ui-749c8fbb6673a15c6477b43d6a6a4f7101f85a5b.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.core.js')
-rw-r--r-- | ui/jquery.ui.core.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index d8fff91e1..a511de24b 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -9,6 +9,9 @@ */ (function( $, undefined ) { +var uuid = 0, + runiqueId = /^ui-id-\d+$/; + // prevent duplicate loading // this is only a problem because we proxy existing functions // and we don't want to double proxy them @@ -107,6 +110,22 @@ $.fn.extend({ return 0; }, + uniqueId: function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + (++uuid); + } + }); + }, + + removeUniqueId: function() { + return this.each(function() { + if ( runiqueId.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + }, + disableSelection: function() { return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + ".ui-disableSelection", function( event ) { |