diff options
author | Ca-Phun Ung <pazu2k@gmail.com> | 2008-09-22 11:22:14 +0000 |
---|---|---|
committer | Ca-Phun Ung <pazu2k@gmail.com> | 2008-09-22 11:22:14 +0000 |
commit | b6ad9598110ca43f164c93b71d4cfbb393a043f2 (patch) | |
tree | 998d4c6c223b80ac95965f26bfbfcca286eadac6 | |
parent | dcb341e7f8a5ddc3dc94b00f9d9fc7e3867958b3 (diff) | |
download | jquery-ui-b6ad9598110ca43f164c93b71d4cfbb393a043f2.tar.gz jquery-ui-b6ad9598110ca43f164c93b71d4cfbb393a043f2.zip |
Spinner: implemented init callback via trigger (thanks Scott González)
-rw-r--r-- | tests/visual/spinner.html | 2 | ||||
-rw-r--r-- | ui/ui.spinner.js | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/tests/visual/spinner.html b/tests/visual/spinner.html index f5b441e26..c3f12ad29 100644 --- a/tests/visual/spinner.html +++ b/tests/visual/spinner.html @@ -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>'); } diff --git a/ui/ui.spinner.js b/ui/ui.spinner.js index 572611b5d..94e2e00f2 100644 --- a/ui/ui.spinner.js +++ b/ui/ui.spinner.js @@ -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')) { |