]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: spinner casing now sets itself a unique id based on the id of the original...
authorCa-Phun Ung <pazu2k@gmail.com>
Sun, 5 Oct 2008 10:44:15 +0000 (10:44 +0000)
committerCa-Phun Ung <pazu2k@gmail.com>
Sun, 5 Oct 2008 10:44:15 +0000 (10:44 +0000)
ui/ui.spinner.js

index d0069b177a5edf230a77b1012bd7860d56349cc6..71da1d15ba05bd1be9c35eb02f93ce1f3795cf5c 100644 (file)
@@ -138,6 +138,14 @@ $.widget('ui.spinner', {
                                })
                        .end();
                
+               // Give the spinner casing a unique id only if one exists in original input 
+               // - this should aid targetted customisations if a page contains multiple instances
+               this.element.attr('id', function(){
+                       if (this.id) {
+                               $(this).parent().attr('id', this.id+'-ui-spinner');
+                       }
+               });
+               
                // DataList: Set contraints for object length and step size. 
                // Manipulate height of spinner.
                this._items = this.element.children().length;