mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Custom comparisons, performance improvements
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user