From 90cd35bfc37878b4788c128303f5154cdf8b769f Mon Sep 17 00:00:00 2001 From: Colin McLeod Date: Mon, 4 May 2015 21:21:16 -0700 Subject: [PATCH] more select bug fixes --- app/js/directives/directive-component-select.js | 12 +++++++----- app/views/page-outfit.html | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/js/directives/directive-component-select.js b/app/js/directives/directive-component-select.js index 8331f78a..4c54119d 100644 --- a/app/js/directives/directive-component-select.js +++ b/app/js/directives/directive-component-select.js @@ -2,13 +2,13 @@ angular.module('app').directive('componentSelect', function() { // Generting the HTML in this manner is MUCH faster than using an angular template. - function appendGroup(list, opts, cid, mass) { + function appendGroup(list, opts, cid, mass, wrap) { var prevClass = null, prevRating = null; for (var i = 0; i < opts.length; i++) { var o = opts[i]; var id = o.id || (o.class + o.rating); // Common components' ID is their class and rating list.push('
  • ', o.class, o.rating); if(o.mode) { @@ -30,7 +30,8 @@ angular.module('app').directive('componentSelect', function() { opts: '=', // Component Options object groups: '=', // Groups of Component Options mass: '=', // Current ship unladen mass - s: '=' // Current Slot + s: '=', // Current Slot + wrap: '@' // Wrap on class }, link: function(scope, element) { var list = []; @@ -39,6 +40,7 @@ angular.module('app').directive('componentSelect', function() { var opts = scope.opts; var groups = scope.groups; var mass = scope.mass || 0; + var wrap = scope.wrap; if(groups) { // At present time slots with grouped options (Hardpoints and Internal) can be empty @@ -47,12 +49,12 @@ angular.module('app').directive('componentSelect', function() { var grp = groups[g]; var grpCode = grp[Object.keys(grp)[0]].grp; // Nasty operation to get the grp property of the first/any single component list.push('
    ', g, '
    '); } } else { list.push(''); } diff --git a/app/views/page-outfit.html b/app/views/page-outfit.html index cf8d7c02..7314d7e3 100644 --- a/app/views/page-outfit.html +++ b/app/views/page-outfit.html @@ -49,7 +49,7 @@
    Max: {{th.c.maxmass}} T
    {{th.c.mass}} T
    -
    +