').addClass($attrs.class);
var titleEle = jqLite('');
var navEle = {};
var lastViewBtnsEle = {};
@@ -60,7 +60,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
// append title in the header, this is the rock to where buttons append
headerBarEle.append(titleEle);
- forEach(BUTTON_TYPES, function(buttonType){
+ forEach(BUTTON_TYPES, function(buttonType) {
// create default button elements
navEle[buttonType] = createNavElement(buttonType);
// append and position buttons
@@ -69,7 +69,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
// compile header and append to the DOM
containerEle.append(headerBarEle);
- $element.append( $compile(containerEle)($scope.$new()) );
+ $element.append($compile(containerEle)($scope.$new()));
var headerBarCtrl = headerBarEle.data('$ionHeaderBarController');
@@ -114,7 +114,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
return headerBarEle;
},
afterLeave: function() {
- forEach(BUTTON_TYPES, function(buttonType){
+ forEach(BUTTON_TYPES, function(buttonType) {
headerBarInstance.removeButtons(buttonType);
});
headerBarCtrl.resetBackButton();
@@ -123,7 +123,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
return headerBarCtrl;
},
destroy: function() {
- forEach(BUTTON_TYPES, function(buttonType){
+ forEach(BUTTON_TYPES, function(buttonType) {
headerBarInstance.removeButtons(buttonType);
});
containerEle.scope().$destroy();
@@ -187,7 +187,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
self.navElement = function(type, html) {
- if ( isDefined(html) ) {
+ if (isDefined(html)) {
navElementHtml[type] = html;
}
return navElementHtml[type];
@@ -214,7 +214,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
// update the buttons, depending if the view has their own or not
if (viewData.buttons) {
- forEach(BUTTON_TYPES, function(buttonType){
+ forEach(BUTTON_TYPES, function(buttonType) {
enteringHeaderBar.setButtons(viewData.buttons[buttonType], buttonType);
});
}
@@ -238,7 +238,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
ionic.DomUtil.cachedAttr($element, 'nav-bar-transition', $ionicConfig.navBar.transition());
ionic.DomUtil.cachedAttr($element, 'nav-bar-direction', viewData.direction);
- if(navBarTransition.shouldAnimate) {
+ if (navBarTransition.shouldAnimate) {
navBarAttr(enteringHeaderBar, 'stage');
} else {
navBarAttr(enteringHeaderBar, 'entering');
@@ -261,7 +261,7 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
queuedTransitionEnd = function() {
if (latestTransitionId == transitionId || !navBarTransition.shouldAnimate) {
- for (var x=0; x= self.tabs.length) return;
+ if (tabIndex >= self.tabs.length) return;
tab = self.tabs[tabIndex];
} else {
tabIndex = self.tabs.indexOf(tab);
@@ -92,4 +92,3 @@ function($scope, $ionicHistory, $element) {
}
};
}]);
-
diff --git a/js/angular/directive/menuClose.js b/js/angular/directive/menuClose.js
index aea39dd3c7..e449ba5b25 100644
--- a/js/angular/directive/menuClose.js
+++ b/js/angular/directive/menuClose.js
@@ -22,7 +22,7 @@ IonicModule
return {
restrict: 'AC',
link: function($scope, $element, $attr) {
- $element.bind('click', function(){
+ $element.bind('click', function() {
var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');
if (sideMenuCtrl) {
// lower priority than navAnimation which allows navTransition
diff --git a/js/angular/directive/menuToggle.js b/js/angular/directive/menuToggle.js
index 92f5377133..9079311cb1 100644
--- a/js/angular/directive/menuToggle.js
+++ b/js/angular/directive/menuToggle.js
@@ -25,10 +25,10 @@ IonicModule
return {
restrict: 'AC',
link: function($scope, $element, $attr) {
- $scope.$on('$ionicView.beforeEnter', function(ev, viewData){
+ $scope.$on('$ionicView.beforeEnter', function(ev, viewData) {
if (viewData.showBack) {
var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');
- if ( !sideMenuCtrl.enableMenuWithBackViews() ) {
+ if (!sideMenuCtrl.enableMenuWithBackViews()) {
$element.addClass('hide');
}
} else {
@@ -36,11 +36,10 @@ IonicModule
}
});
- $element.bind('click', function(){
+ $element.bind('click', function() {
var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');
sideMenuCtrl && sideMenuCtrl.toggle($attr.menuToggle);
});
}
};
});
-
diff --git a/js/angular/directive/navDirection.js b/js/angular/directive/navDirection.js
index 0c2bf51d98..2d9ba076a5 100644
--- a/js/angular/directive/navDirection.js
+++ b/js/angular/directive/navDirection.js
@@ -20,8 +20,8 @@ IonicModule
restrict: 'A',
priority: 1000,
link: function($scope, $element, $attr) {
- $element.bind('click', function(){
- $ionicViewSwitcher.nextDirection( $attr.navDirection );
+ $element.bind('click', function() {
+ $ionicViewSwitcher.nextDirection($attr.navDirection);
});
}
};
diff --git a/js/angular/directive/navTransition.js b/js/angular/directive/navTransition.js
index 0cf72646c4..fef9a03120 100644
--- a/js/angular/directive/navTransition.js
+++ b/js/angular/directive/navTransition.js
@@ -20,8 +20,8 @@ IonicModule
restrict: 'A',
priority: 1000,
link: function($scope, $element, $attr) {
- $element.bind('click', function(){
- $ionicViewSwitcher.nextTransition( $attr.navTransition );
+ $element.bind('click', function() {
+ $ionicViewSwitcher.nextTransition($attr.navTransition);
});
}
};
diff --git a/js/angular/directive/navView.js b/js/angular/directive/navView.js
index aa7c4858c1..ee84d1fbb5 100644
--- a/js/angular/directive/navView.js
+++ b/js/angular/directive/navView.js
@@ -94,7 +94,7 @@ function($state, $ionicConfig) {
priority: 2000,
transclude: true,
controller: '$ionicNavView',
- compile: function (tElement, tAttrs, transclude) {
+ compile: function(tElement, tAttrs, transclude) {
// a nav view element is a container for numerous views
tElement.addClass('view-container');
@@ -104,8 +104,8 @@ function($state, $ionicConfig) {
var latestLocals;
// Put in the compiled initial view
- transclude($scope, function(clone){
- $element.append( clone );
+ transclude($scope, function(clone) {
+ $element.append(clone);
});
var viewData = navViewCtrl.init();
@@ -142,4 +142,3 @@ function($state, $ionicConfig) {
}
};
}]);
-
diff --git a/js/angular/directive/sideMenus.js b/js/angular/directive/sideMenus.js
index 5eb0811bb3..11dd2ea4c7 100644
--- a/js/angular/directive/sideMenus.js
+++ b/js/angular/directive/sideMenus.js
@@ -80,15 +80,15 @@ IonicModule
return { pre: prelink };
function prelink($scope, $element, $attrs, ctrl) {
- ctrl.enableMenuWithBackViews( $scope.$eval($attrs.enableMenuWithBackViews) );
+ ctrl.enableMenuWithBackViews($scope.$eval($attrs.enableMenuWithBackViews));
- $scope.$on('$ionicExposeAside', function(evt, isAsideExposed){
- if(!$scope.$exposeAside) $scope.$exposeAside = {};
+ $scope.$on('$ionicExposeAside', function(evt, isAsideExposed) {
+ if (!$scope.$exposeAside) $scope.$exposeAside = {};
$scope.$exposeAside.active = isAsideExposed;
$ionicBody.enableClass(isAsideExposed, 'aside-open');
});
- $scope.$on('$destroy', function(){
+ $scope.$on('$destroy', function() {
$ionicBody.removeClass('menu-open', 'aside-open');
});
diff --git a/js/angular/service/actionSheet.js b/js/angular/service/actionSheet.js
index 3200fb1743..7129e01e80 100644
--- a/js/angular/service/actionSheet.js
+++ b/js/angular/service/actionSheet.js
@@ -119,7 +119,7 @@ function($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicP
scope.removed = true;
sheetEl.removeClass('action-sheet-up');
- $timeout(function(){
+ $timeout(function() {
// wait to remove this due to a 300ms delay native
// click which would trigging whatever was underneath this
$ionicBody.removeClass('action-sheet-open');
@@ -146,7 +146,7 @@ function($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicP
if (scope.removed) return;
(done || angular.noop)();
});
- $timeout(function(){
+ $timeout(function() {
if (scope.removed) return;
sheetEl.addClass('action-sheet-up');
}, 20, false);
diff --git a/js/angular/service/history.js b/js/angular/service/history.js
index 15b1d2e607..6b7e840e19 100644
--- a/js/angular/service/history.js
+++ b/js/angular/service/history.js
@@ -13,7 +13,7 @@ IonicModule
function($rootScope, $state, $location, $document, $ionicPlatform, $ionicHistory) {
// always reset the keyboard state when change stage
- $rootScope.$on('$stateChangeStart', function(){
+ $rootScope.$on('$stateChangeStart', function() {
ionic.keyboard.hide();
});
@@ -22,7 +22,7 @@ function($rootScope, $state, $location, $document, $ionicPlatform, $ionicHistory
var viewHistory = $ionicHistory.viewHistory();
- var hist = (data.historyId ? viewHistory.histories[ data.historyId ] : null );
+ var hist = (data.historyId ? viewHistory.histories[ data.historyId ] : null);
if (hist && hist.cursor > -1 && hist.cursor < hist.stack.length) {
// the history they're going to already exists
// go to it's last view in its stack
@@ -113,10 +113,10 @@ function($rootScope, $state, $location, $window) {
currentView: null
};
- var View = function(){};
+ var View = function() {};
View.prototype.initialize = function(data) {
if (data) {
- for(var name in data) this[name] = data[name];
+ for (var name in data) this[name] = data[name];
return this;
}
return null;
@@ -150,25 +150,25 @@ function($rootScope, $state, $location, $window) {
function getViewById(viewId) {
- return (viewId ? viewHistory.views[ viewId ] : null );
+ return (viewId ? viewHistory.views[ viewId ] : null);
}
function getBackView(view) {
- return (view ? getViewById(view.backViewId) : null );
+ return (view ? getViewById(view.backViewId) : null);
}
function getForwardView(view) {
- return (view ? getViewById(view.forwardViewId) : null );
+ return (view ? getViewById(view.forwardViewId) : null);
}
function getHistoryById(historyId) {
- return (historyId ? viewHistory.histories[ historyId ] : null );
+ return (historyId ? viewHistory.histories[ historyId ] : null);
}
function getHistory(scope) {
var histObj = getParentHistoryObj(scope);
- if ( !viewHistory.histories[ histObj.historyId ] ) {
+ if (!viewHistory.histories[ histObj.historyId ]) {
// this history object exists in parent scope, but doesn't
// exist in the history data yet
viewHistory.histories[ histObj.historyId ] = {
@@ -183,7 +183,7 @@ function($rootScope, $state, $location, $window) {
function getParentHistoryObj(scope) {
var parentScope = scope;
- while(parentScope) {
+ while (parentScope) {
if (parentScope.hasOwnProperty('$historyId')) {
// this parent scope has a historyId
return { historyId: parentScope.$historyId, scope: parentScope };
@@ -206,7 +206,7 @@ function($rootScope, $state, $location, $window) {
if ($state && $state.current && $state.current.name) {
id = $state.current.name;
if ($state.params) {
- for(var key in $state.params) {
+ for (var key in $state.params) {
if ($state.params.hasOwnProperty(key) && $state.params[key]) {
id += "_" + key + "=" + $state.params[key];
}
@@ -221,7 +221,7 @@ function($rootScope, $state, $location, $window) {
function getCurrentStateParams() {
var rtn;
if ($state && $state.params) {
- for(var key in $state.params) {
+ for (var key in $state.params) {
if ($state.params.hasOwnProperty(key)) {
rtn = rtn || {};
rtn[key] = $state.params[key];
@@ -247,7 +247,7 @@ function($rootScope, $state, $location, $window) {
historyId = hist.historyId,
tmp;
- if ( isAbstractView ) {
+ if (isAbstractView) {
// abstract states should not register themselves in the history stack
return {
action: 'abstractView',
@@ -366,7 +366,7 @@ function($rootScope, $state, $location, $window) {
tmp = getHistoryById(forwardView.historyId);
if (tmp) {
// the forward has a history
- for(var x=tmp.stack.length - 1; x >= forwardView.index; x--) {
+ for (var x=tmp.stack.length - 1; x >= forwardView.index; x--) {
// starting from the end destroy all forwards in this history from this point
tmp.stack[x].destroy();
tmp.stack.splice(x);
@@ -510,7 +510,7 @@ function($rootScope, $state, $location, $window) {
currentView = viewHistory.currentView;
if (histories) {
- for(var historyId in histories) {
+ for (var historyId in histories) {
if (histories[historyId].stack) {
histories[historyId].stack = [];
@@ -527,7 +527,7 @@ function($rootScope, $state, $location, $window) {
}
}
- for(var viewId in viewHistory.views) {
+ for (var viewId in viewHistory.views) {
if (viewId !== currentView.viewId) {
delete viewHistory.views[viewId];
}
diff --git a/js/angular/service/ionicConfig.js b/js/angular/service/ionicConfig.js
index 39b3f1ba01..af9245b019 100644
--- a/js/angular/service/ionicConfig.js
+++ b/js/angular/service/ionicConfig.js
@@ -173,11 +173,11 @@ IonicModule
return {
run: function(step) {
if (direction == 'forward') {
- setStyles(enteringEle, 1, (1-step) * 99); // starting at 98% prevents a flicker
+ setStyles(enteringEle, 1, (1 - step) * 99); // starting at 98% prevents a flicker
setStyles(leavingEle, (1 - 0.1 * step), step * -33);
} else if (direction == 'back') {
- setStyles(enteringEle, (1 - 0.1 * (1-step)), (1-step) * -33);
+ setStyles(enteringEle, (1 - 0.1 * (1 - step)), (1 - step) * -33);
setStyles(leavingEle, 1, step * 100);
} else {
@@ -235,8 +235,8 @@ IonicModule
var enteringHeaderCtrl = enteringHeaderBar.controller();
var leavingHeaderCtrl = leavingHeaderBar && leavingHeaderBar.controller();
if (direction == 'back') {
- leave(enteringHeaderCtrl, leavingHeaderCtrl, 1-step);
- enter(leavingHeaderCtrl, enteringHeaderCtrl, 1-step);
+ leave(enteringHeaderCtrl, leavingHeaderCtrl, 1 - step);
+ enter(leavingHeaderCtrl, enteringHeaderCtrl, 1 - step);
} else {
enter(enteringHeaderCtrl, leavingHeaderCtrl, step);
leave(leavingHeaderCtrl, enteringHeaderCtrl, step);
@@ -296,12 +296,12 @@ IonicModule
return {
run: function(step) {
if (direction == 'forward') {
- setStyles(enteringEle, step, (1-step) * startX);
+ setStyles(enteringEle, step, (1 - step) * startX);
setStyles(leavingEle, 1, 0);
} else if (direction == 'back') {
setStyles(enteringEle, 1, 0);
- setStyles(leavingEle, (1-step), step * startX);
+ setStyles(leavingEle, (1 - step), step * startX);
} else {
// swap, enter, exit
@@ -339,12 +339,12 @@ IonicModule
var leavingEle = leavingHeaderBar && leavingHeaderBar.containerEle();
if (direction == 'forward') {
- setStyles(enteringEle, step, (1-step) * startX, 10);
+ setStyles(enteringEle, step, (1 - step) * startX, 10);
setStyles(leavingEle, 1, 0, 9);
} else if (direction == 'back') {
setStyles(enteringEle, 1, 0, 9);
- setStyles(leavingEle, (1-step), step * startX, 10);
+ setStyles(leavingEle, (1 - step), step * startX, 10);
} else {
// swap, enter, exit
@@ -386,13 +386,13 @@ IonicModule
function addConfig(configObj, platformObj) {
for (var n in configObj) {
if (n != PLATFORM && configObj.hasOwnProperty(n)) {
- if ( angular.isObject(configObj[n]) ) {
+ if (angular.isObject(configObj[n])) {
if (!isDefined(platformObj[n])) {
platformObj[n] = {};
}
addConfig(configObj[n], platformObj[n]);
- } else if( !isDefined(platformObj[n]) ) {
+ } else if (!isDefined(platformObj[n])) {
platformObj[n] = null;
}
}
@@ -402,7 +402,7 @@ IonicModule
// private: create methods for each config to get/set
function createConfig(configObj, providerObj, platformPath) {
- forEach(configObj, function(value, namespace){
+ forEach(configObj, function(value, namespace) {
if (angular.isObject(configObj[namespace])) {
// recursively drill down the config object so we can create a method for each one
@@ -434,7 +434,7 @@ IonicModule
function stringObj(obj, str) {
str = str.split(".");
for (var i = 0; i < str.length; i++) {
- if ( obj && isDefined(obj[str[i]]) ) {
+ if (obj && isDefined(obj[str[i]])) {
obj = obj[str[i]];
} else {
return null;
diff --git a/js/angular/service/platform.js b/js/angular/service/platform.js
index 0b17e6b215..63bd8755b5 100644
--- a/js/angular/service/platform.js
+++ b/js/angular/service/platform.js
@@ -72,7 +72,7 @@ IonicModule
$backButtonActions: {},
registerBackButtonAction: function(fn, priority, actionId) {
- if(!self._hasBackButtonHandler) {
+ if (!self._hasBackButtonHandler) {
// add a back button listener if one hasn't been setup yet
self.$backButtonActions = {};
self.onHardwareBackButton(self.hardwareBackButtonClick);
@@ -95,16 +95,16 @@ IonicModule
/**
* @private
*/
- hardwareBackButtonClick: function(e){
+ hardwareBackButtonClick: function(e) {
// loop through all the registered back button actions
// and only run the last one of the highest priority
var priorityAction, actionId;
- for(actionId in self.$backButtonActions) {
- if(!priorityAction || self.$backButtonActions[actionId].priority >= priorityAction.priority) {
+ for (actionId in self.$backButtonActions) {
+ if (!priorityAction || self.$backButtonActions[actionId].priority >= priorityAction.priority) {
priorityAction = self.$backButtonActions[actionId];
}
}
- if(priorityAction) {
+ if (priorityAction) {
priorityAction.fn(e);
return priorityAction;
}
@@ -126,11 +126,11 @@ IonicModule
* @returns {function} Returns a deregistration function to remove the event listener.
*/
on: function(type, cb) {
- ionic.Platform.ready(function(){
+ ionic.Platform.ready(function() {
document.addEventListener(type, cb, false);
});
return function() {
- ionic.Platform.ready(function(){
+ ionic.Platform.ready(function() {
document.removeEventListener(type, cb);
});
};
@@ -148,7 +148,7 @@ IonicModule
ready: function(cb) {
var q = $q.defer();
- ionic.Platform.ready(function(){
+ ionic.Platform.ready(function() {
q.resolve();
cb && cb();
});
@@ -161,4 +161,3 @@ IonicModule
};
});
-
diff --git a/js/angular/service/templateCache.js b/js/angular/service/templateCache.js
index 0cdbfe1081..4079bd7b26 100644
--- a/js/angular/service/templateCache.js
+++ b/js/angular/service/templateCache.js
@@ -78,7 +78,7 @@ function($http, $templateCache, $timeout) {
if (toCache.length === 0) return;
var i = 0;
- while (i < 4 && (template = toCache.pop()) ) {
+ while (i < 4 && (template = toCache.pop())) {
// note that inline templates are ignored by this request
if (isString(template)) $http.get(template, { cache: $templateCache });
i++;
diff --git a/js/angular/service/viewSwitcher.js b/js/angular/service/viewSwitcher.js
index d63a7e882c..2a9cae5dbf 100644
--- a/js/angular/service/viewSwitcher.js
+++ b/js/angular/service/viewSwitcher.js
@@ -50,8 +50,8 @@ function($timeout, $compile, $controller, $document, $ionicClickBlock, $ionicCon
}
function getViewElementIdentifier(locals, view) {
- if ( viewState(locals).abstract ) return viewState(locals).name;
- if ( view ) return view.stateId || view.viewId;
+ if (viewState(locals).abstract) return viewState(locals).name;
+ if (view) return view.stateId || view.viewId;
return ionic.Utils.nextUid();
}
@@ -113,7 +113,7 @@ function($timeout, $compile, $controller, $document, $ionicClickBlock, $ionicCon
$ionicClickBlock.show();
switcher.loadViewElements();
- switcher.render(registerData, function(){
+ switcher.render(registerData, function() {
callback && callback();
});
},
@@ -123,7 +123,7 @@ function($timeout, $compile, $controller, $document, $ionicClickBlock, $ionicCon
var enteringEleIdentifier = getViewElementIdentifier(viewLocals, enteringView);
var navViewActiveEleId = navViewElement.data(DATA_ACTIVE_ELE_IDENTIFIER);
- for (var x=0, l=viewElements.length; x $ionicConfig.views.maxCache() ) {
+ } else if ((viewElementsLength - 1) > $ionicConfig.views.maxCache()) {
// check to see if we have more cached views than we should
// the total number of child elements has exceeded how many to keep in the DOM
var oldestAccess = Date.now();
- for (x=0; x x2) return false;
- if(y < y1 || y > y2) return false;
+ if (x < x1 || x > x2) return false;
+ if (y < y1 || y > y2) return false;
return true;
},
@@ -264,7 +264,7 @@
* @returns {DOMElement} The element blurred or null
*/
blurAll: function() {
- if (document.activeElement && document.activeElement != document.body){
+ if (document.activeElement && document.activeElement != document.body) {
document.activeElement.blur();
return document.activeElement;
}
@@ -291,7 +291,7 @@
ele = ele && ele.length && ele[0] || ele;
if (ele && ele.style) {
for (var prop in styles) {
- if ( ele['$style-' + prop] !== styles[prop] ) {
+ if (ele['$style-' + prop] !== styles[prop]) {
ele.style[prop] = ele['$style-' + prop] = styles[prop];
}
}
@@ -303,4 +303,5 @@
ionic.requestAnimationFrame = ionic.DomUtil.requestAnimationFrame;
ionic.cancelAnimationFrame = ionic.DomUtil.cancelAnimationFrame;
ionic.animationFrameThrottle = ionic.DomUtil.animationFrameThrottle;
+
})(window, document, ionic);