mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Spinner: implemented init callback via trigger (thanks Scott González)
This commit is contained in:
parent
dcb341e7f8
commit
b6ad959811
@ -36,7 +36,7 @@ $(function(){
|
||||
// Two methods of adding external items to the spinner
|
||||
//
|
||||
// method 1: on initalisation call the add method directly and format html manually
|
||||
init: function(ui) {
|
||||
init: function(e, ui) {
|
||||
for (var i=0; i<itemList.length; i++) {
|
||||
ui.add('<a href="'+ itemList[i].url +'" target="_blank">'+ itemList[i].title +'</a>');
|
||||
}
|
||||
|
@ -18,9 +18,7 @@ $.widget('ui.spinner', {
|
||||
if($.data(this.element[0], 'spinner')) return;
|
||||
|
||||
// check for Init callback
|
||||
if (this.options.init) {
|
||||
this.options.init(this.ui(null));
|
||||
}
|
||||
this._trigger('init', null, this.ui(null));
|
||||
|
||||
// perform data bind on generic objects
|
||||
if (typeof this.options.items[0] == 'object' && !this.element.is('input')) {
|
||||
|
Loading…
Reference in New Issue
Block a user