mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 15:15:34 +00:00
Improved error handling and error page
This commit is contained in:
@@ -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="');
|
||||
|
||||
Reference in New Issue
Block a user