From b6ad9598110ca43f164c93b71d4cfbb393a043f2 Mon Sep 17 00:00:00 2001 From: Ca-Phun Ung Date: Mon, 22 Sep 2008 11:22:14 +0000 Subject: Spinner: implemented init callback via trigger (thanks Scott González) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/visual/spinner.html | 2 +- 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[i].title +''); } 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')) { -- cgit v1.2.3