+ Fixed a typo in iQ.each that was breaking everything

+ Rearranged the UIClass initialization sequence a little, to make sure everything happens in the right sequence
This commit is contained in:
Ian Gilman 2010-07-14 11:21:07 -07:00
parent 8e3ec23810
commit 0896f3fae1
2 changed files with 41 additions and 32 deletions

View File

@ -568,13 +568,28 @@ window.Page = {
// Class: UIClass
// Singleton top-level UI manager. TODO: Integrate with <Page>.
function UIClass(){
if (window.Tabs)
this.init();
else {
var self = this;
TabsManager.addSubscriber(this, 'load', function() {
self.init();
});
try {
Utils.log('TabCandy init --------------------');
// Variable: navBar
// A reference to the <Navbar>, for manipulating the browser's nav bar.
this.navBar = Navbar;
// Variable: tabBar
// A reference to the <Tabbar>, for manipulating the browser's tab bar.
this.tabBar = Tabbar;
// Variable: devMode
// If true (set by an url parameter), adds extra features to the screen.
// TODO: Integrate with the dev menu
this.devMode = false;
// Variable: currentTab
// Keeps track of which <Tabs> tab we are currently on.
// Used to facilitate zooming down from a previous tab.
this.currentTab = Utils.activeTab;
} catch(e) {
Utils.log(e);
}
};
@ -583,26 +598,22 @@ UIClass.prototype = {
// ----------
init: function() {
try {
Utils.log('TabCandy init --------------------');
// Variable: navBar
// A reference to the <Navbar>, for manipulating the browser's nav bar.
this.navBar = Navbar;
// Variable: tabBar
// A reference to the <Tabbar>, for manipulating the browser's tab bar.
this.tabBar = Tabbar;
// Variable: devMode
// If true (set by an url parameter), adds extra features to the screen.
// TODO: Integrate with the dev menu
this.devMode = false;
// Variable: currentTab
// Keeps track of which <Tabs> tab we are currently on.
// Used to facilitate zooming down from a previous tab.
this.currentTab = Utils.activeTab;
if (window.Tabs)
this._secondaryInit();
else {
var self = this;
TabsManager.addSubscriber(this, 'load', function() {
self._secondaryInit();
});
}
} catch(e) {
Utils.log(e);
}
},
// -----------
_secondaryInit: function() {
try {
var self = this;
this.setBrowserKeyHandler();
@ -650,10 +661,7 @@ UIClass.prototype = {
self.delayInit();
});
} catch(e) {
Utils.log("Error in UIClass(): " + e);
Utils.log(e.fileName);
Utils.log(e.lineNumber);
Utils.log(e.stack);
Utils.log(e);
}
},
@ -1145,5 +1153,6 @@ UIClass.prototype = {
// ----------
window.UI = new UIClass();
window.UI.init();
})();

View File

@ -227,7 +227,7 @@ iQ.fn = iQ.prototype = {
// Function: each
// Execute a callback for every element in the matched set.
each: function( callback ) {
if ( !iQ.isFunction(value) ) {
if ( !iQ.isFunction(callback) ) {
Utils.assert("each's argument must be a function", false);
return null;
}