r732 - in trunk: tests/visual ui

r732 - in trunk: tests/visual ui

Author: pazu2k@gmail.com
Date: Mon Sep 22 04:22:14 2008
New Revision: 732
Modified:
trunk/tests/visual/spinner.html
trunk/ui/ui.spinner.js
Log:
Spinner: implemented init callback via trigger (thanks Scott González)
Modified: trunk/tests/visual/spinner.html
==============================================================================
--- trunk/tests/visual/spinner.html    (original)
+++ trunk/tests/visual/spinner.html    Mon Sep 22 04:22:14 2008
@@ -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>');
                }
Modified: trunk/ui/ui.spinner.js
==============================================================================
--- trunk/ui/ui.spinner.js    (original)
+++ trunk/ui/ui.spinner.js    Mon Sep 22 04:22:14 2008
@@ -18,9 +18,7 @@
        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')) {