mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Removed excessive js file wrapping code
I don't think we need to pass in window or document.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
(function(window, document, ionic) {
|
(function(ionic) {
|
||||||
NavController = function(opts) {
|
NavController = function(opts) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
@ -102,4 +102,4 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
})(this, document, this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
(function(window, document, ionic) {
|
(function(ionic) {
|
||||||
|
|
||||||
SideMenuController = function(options) {
|
SideMenuController = function(options) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
@ -188,4 +188,4 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
})(this, document, ion = this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
(function(window, document, ionic) {
|
(function(ionic) {
|
||||||
|
|
||||||
TabBarController = function(options) {
|
TabBarController = function(options) {
|
||||||
this.tabBar = options.tabBar;
|
this.tabBar = options.tabBar;
|
||||||
@ -119,4 +119,4 @@ TabBarController.prototype = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
})(this, document, ion = this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
* Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys!
|
* Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function(window, document, ion) {
|
(function(ionic) {
|
||||||
ionic.EventController = {
|
ionic.EventController = {
|
||||||
VIRTUALIZED_EVENTS: ['tap', 'swipe', 'swiperight', 'swipeleft', 'drag', 'hold', 'release'],
|
VIRTUALIZED_EVENTS: ['tap', 'swipe', 'swiperight', 'swipeleft', 'drag', 'hold', 'release'],
|
||||||
|
|
||||||
@ -106,4 +106,4 @@
|
|||||||
// Set up various listeners
|
// Set up various listeners
|
||||||
window.addEventListener('click', ionic.EventController.handleClick);
|
window.addEventListener('click', ionic.EventController.handleClick);
|
||||||
|
|
||||||
})(this, document, ionic = this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
* Simple gesture controllers with some common gestures that emit
|
* Simple gesture controllers with some common gestures that emit
|
||||||
* gesture events.
|
* 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
|
* ionic.Gestures
|
||||||
@ -1425,4 +1425,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(this, document, ionic = this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
44
js/ionic.js
44
js/ionic.js
@ -1,28 +1,26 @@
|
|||||||
(function(window, document, ion) {
|
window.ionic = {};
|
||||||
|
|
||||||
function initalize() {
|
function initalize() {
|
||||||
// remove the ready listeners
|
// remove the ready listeners
|
||||||
document.removeEventListener( "DOMContentLoaded", initalize, false );
|
document.removeEventListener( "DOMContentLoaded", initalize, false );
|
||||||
window.removeEventListener( "load", initalize, false );
|
window.removeEventListener( "load", initalize, false );
|
||||||
|
|
||||||
// trigger that the DOM is ready
|
// trigger that the DOM is ready
|
||||||
ion.trigger("ready");
|
ion.trigger("ready");
|
||||||
|
|
||||||
// trigger that the start page is in view
|
// trigger that the start page is in view
|
||||||
ion.trigger("pageview");
|
ion.trigger("pageview");
|
||||||
|
|
||||||
// trigger that the webapp has been initalized
|
// trigger that the webapp has been initalized
|
||||||
ion.trigger("initalized");
|
ion.trigger("initalized");
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the DOM is ready, initalize the webapp
|
// When the DOM is ready, initalize the webapp
|
||||||
if ( document.readyState === "complete" ) {
|
if ( document.readyState === "complete" ) {
|
||||||
// DOM is already ready
|
// DOM is already ready
|
||||||
setTimeout( initalize );
|
setTimeout( initalize );
|
||||||
} else {
|
} else {
|
||||||
// DOM isn't ready yet, add event listeners
|
// DOM isn't ready yet, add event listeners
|
||||||
document.addEventListener( "DOMContentLoaded", initalize, false );
|
document.addEventListener( "DOMContentLoaded", initalize, false );
|
||||||
window.addEventListener( "load", initalize, false );
|
window.addEventListener( "load", initalize, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
})(this, document, ion = this.ion || {});
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
(function(window, document, ion) {
|
(function(ionic) {
|
||||||
|
|
||||||
ion.Utils = {
|
ionic.Utils = {
|
||||||
/**
|
/**
|
||||||
* extend method,
|
* extend method,
|
||||||
* also used for cloning when dest is an empty object
|
* also used for cloning when dest is an empty object
|
||||||
@ -19,4 +19,4 @@
|
|||||||
return dest;
|
return dest;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})(this, document, ion = this.ion || {});
|
})(window.ionic);
|
||||||
|
|||||||
@ -11,4 +11,4 @@
|
|||||||
destroy: function() {
|
destroy: function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(this.ionic);
|
})(window.ionic);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
(function(window, document, ionic) {
|
(function(ionic) {
|
||||||
|
|
||||||
NavBar = function(opts) {
|
NavBar = function(opts) {
|
||||||
this.el = opts.el;
|
this.el = opts.el;
|
||||||
@ -39,5 +39,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(this, document, ion = this.ionic || {});
|
})(window.ionic);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
(function(window, document, ionic) {
|
(function(ionic) {
|
||||||
SideMenu = function(opts) {
|
SideMenu = function(opts) {
|
||||||
this.el = opts.el;
|
this.el = opts.el;
|
||||||
this.width = opts.width;
|
this.width = opts.width;
|
||||||
@ -19,4 +19,4 @@
|
|||||||
this.el.style.zIndex = -1;
|
this.el.style.zIndex = -1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(this, document, ion = this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
(function(window, document, ionic) {
|
(function(ionic) {
|
||||||
|
|
||||||
TabBarItem = function(el) {
|
TabBarItem = function(el) {
|
||||||
this.el = el;
|
this.el = el;
|
||||||
@ -198,4 +198,4 @@ TabBar.prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
})(this, document, this.ionic || {});
|
})(window.ionic);
|
||||||
|
|||||||
Reference in New Issue
Block a user