Improved error handling and error page

This commit is contained in:
Colin McLeod
2015-05-03 18:33:13 -07:00
parent 508679c185
commit 44f5409246
9 changed files with 36 additions and 24 deletions

View File

@@ -2,18 +2,19 @@ angular.module('app').directive('componentSelect', [ function() {
return {
restrict: 'A',
scope:{
opts: '=', // Component Options object
opts: '=', // Component Options object
mass: '=' // Current ship mass
},
link: function(scope, element) {
var list = [], o, id;
var opts = scope.opts;
//TODO: take current ship mass into account if provided
var mass = scope.mass || 0;
// Generting the HTML in this manner is MUCH faster than using an angular template.
for (id in opts) {
o = opts[id];
list.push('<li class="');
list.push(o.name? 'lc' : 'c');
if (false) { // Omit id if mass is exceeded making it 'disabled'
if (o.maxmass && mass > o.maxmass) { // Omit id if mass is exceeded making it 'disabled'
list.push(' disabled"');
} else {
list.push('" id="');