Custom comparisons, performance improvements

This commit is contained in:
Colin McLeod
2015-05-20 00:29:24 -07:00
parent 02fe76f43b
commit 6c1e3a7410
146 changed files with 1096 additions and 1062 deletions

View File

@@ -1,4 +1,4 @@
angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'shipyard', 'ngLodash', 'app.templates'])
angular.module('app', ['ngTouch', 'ui.router', 'ct.ui.router.extras.sticky', 'ui.sortable', 'shipyard', 'ngLodash', 'app.templates'])
.run(['$rootScope', '$location', '$window', '$document','$state','commonArray','shipPurpose','shipSize','hardPointClass','internalGroupMap','hardpointsGroupMap', function ($rootScope, $location, $window, $doc, $state, CArr, shipPurpose, sz, hpc, igMap, hgMap) {
// Redirect any state transition errors to the error controller/state
$rootScope.$on('$stateChangeError', function(e, toState, toParams, fromState, fromParams, error){
@@ -9,8 +9,8 @@ angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'shipyard', 'n
// Track on Google analytics if available
$rootScope.$on('$stateChangeSuccess', function(e, to, toParams, from, fromParams) {
$rootScope.prevState = { name: from.name, params: fromParams };
if(to.url) { // Only track states that have a URL
if ($window.ga) ga('send', 'pageview', {page: $location.path()});
if(to.url && $window.ga) { // Only track states that have a URL
ga('send', 'pageview', {page: $location.path()});
}
});
@@ -26,8 +26,8 @@ angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'shipyard', 'n
// Formatters
$rootScope.fCrd = d3.format(',.0f');
$rootScope.fPwr = d3.format(',.2f');
$rootScope.fRound = function(d) { return d3.round(d, 2) };
$rootScope.fRound4 = function(d) { return d3.round(d, 4) };
$rootScope.fRound = function(d) { return d3.round(d, 2); };
$rootScope.fRound4 = function(d) { return d3.round(d, 4); };
$rootScope.fPct = d3.format('.2%');
$rootScope.fRPct = d3.format('%');
$rootScope.fTime = function(d) { return Math.floor(d/60) + ":" + ("00" + (d%60)).substr(-2,2); };
@@ -44,6 +44,6 @@ angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'shipyard', 'n
$rootScope.bgClicked = function (e) {
$rootScope.$broadcast('close', e);
}
};
}]);