Skip to content
Permalink
Browse files

Spinner: implemented init callback via trigger (thanks Scott González)

  • Loading branch information...
Ca-Phun Ung
Ca-Phun Ung committed Sep 22, 2008
1 parent dcb341e commit b6ad9598110ca43f164c93b71d4cfbb393a043f2
Showing with 2 additions and 4 deletions.
  1. +1 −1 tests/visual/spinner.html
  2. +1 −3 ui/ui.spinner.js
@@ -36,7 +36,7 @@
// 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')) {

0 comments on commit b6ad959

Please sign in to comment.
You can’t perform that action at this time.