Removed excessive js file wrapping code

I don't think we need to pass in window or document.
This commit is contained in:
Max Lynch
2013-09-22 23:56:40 -05:00
parent 86f3efde15
commit 432d9c5ca8
11 changed files with 42 additions and 45 deletions

View File

@ -1,4 +1,4 @@
(function(window, document, ionic) {
(function(ionic) {
NavController = function(opts) {
var _this = this;
@ -102,4 +102,4 @@
},
};
})(this, document, this.ionic || {});
})(window.ionic);

View File

@ -1,4 +1,4 @@
(function(window, document, ionic) {
(function(ionic) {
SideMenuController = function(options) {
var _this = this;
@ -188,4 +188,4 @@
}
};
})(this, document, ion = this.ionic || {});
})(window.ionic);

View File

@ -1,4 +1,4 @@
(function(window, document, ionic) {
(function(ionic) {
TabBarController = function(options) {
this.tabBar = options.tabBar;
@ -119,4 +119,4 @@ TabBarController.prototype = {
},
}
})(this, document, ion = this.ionic || {});
})(window.ionic);

View File

@ -10,7 +10,7 @@
* Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys!
*/
(function(window, document, ion) {
(function(ionic) {
ionic.EventController = {
VIRTUALIZED_EVENTS: ['tap', 'swipe', 'swiperight', 'swipeleft', 'drag', 'hold', 'release'],
@ -106,4 +106,4 @@
// Set up various listeners
window.addEventListener('click', ionic.EventController.handleClick);
})(this, document, ionic = this.ionic || {});
})(window.ionic);

View File

@ -2,9 +2,9 @@
* Simple gesture controllers with some common gestures that emit
* gesture events.
*
* Ported from github.com/EightMedia/ionic.Gestures.js - thanks!
* Ported from github.com/EightMedia/hammer.js - thanks!
*/
(function(window, document, ionic) {
(function(ionic) {
/**
* ionic.Gestures
@ -1425,4 +1425,4 @@
}
}
};
})(this, document, ionic = this.ionic || {});
})(window.ionic);

View File

@ -1,6 +1,6 @@
(function(window, document, ion) {
window.ionic = {};
function initalize() {
function initalize() {
// remove the ready listeners
document.removeEventListener( "DOMContentLoaded", initalize, false );
window.removeEventListener( "load", initalize, false );
@ -13,16 +13,14 @@
// trigger that the webapp has been initalized
ion.trigger("initalized");
}
}
// When the DOM is ready, initalize the webapp
if ( document.readyState === "complete" ) {
// When the DOM is ready, initalize the webapp
if ( document.readyState === "complete" ) {
// DOM is already ready
setTimeout( initalize );
} else {
} else {
// DOM isn't ready yet, add event listeners
document.addEventListener( "DOMContentLoaded", initalize, false );
window.addEventListener( "load", initalize, false );
}
})(this, document, ion = this.ion || {});
}

View File

@ -1,6 +1,6 @@
(function(window, document, ion) {
(function(ionic) {
ion.Utils = {
ionic.Utils = {
/**
* extend method,
* also used for cloning when dest is an empty object
@ -19,4 +19,4 @@
return dest;
},
}
})(this, document, ion = this.ion || {});
})(window.ionic);

View File

@ -11,4 +11,4 @@
destroy: function() {
}
};
})(this.ionic);
})(window.ionic);

View File

@ -1,4 +1,4 @@
(function(window, document, ionic) {
(function(ionic) {
NavBar = function(opts) {
this.el = opts.el;
@ -39,5 +39,4 @@
}
}
};
})(this, document, ion = this.ionic || {});
})(window.ionic);

View File

@ -1,4 +1,4 @@
(function(window, document, ionic) {
(function(ionic) {
SideMenu = function(opts) {
this.el = opts.el;
this.width = opts.width;
@ -19,4 +19,4 @@
this.el.style.zIndex = -1;
}
};
})(this, document, ion = this.ionic || {});
})(window.ionic);

View File

@ -1,4 +1,4 @@
(function(window, document, ionic) {
(function(ionic) {
TabBarItem = function(el) {
this.el = el;
@ -198,4 +198,4 @@ TabBar.prototype = {
}
};
})(this, document, this.ionic || {});
})(window.ionic);