mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Handle component select wrapping edge cases
This commit is contained in:
@@ -3,12 +3,12 @@ angular.module('app').directive('componentSelect', function () {
|
|||||||
// Generting the HTML in this manner is MUCH faster than using an angular template.
|
// 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) {
|
||||||
var prevClass = null;
|
var prevClass = null, prevRating = null;
|
||||||
for (var i = 0; i < opts.length; i++) {
|
for (var i = 0; i < opts.length; i++) {
|
||||||
var o = opts[i];
|
var o = opts[i];
|
||||||
var id = o.id || (o.class + o.rating); // Common components' ID is their class and rating
|
var id = o.id || (o.class + o.rating); // Common components' ID is their class and rating
|
||||||
|
|
||||||
if(i > 0 && opts.length > 3 && o.class != prevClass && o.grp != 'cr') {
|
if(i > 0 && opts.length > 3 && o.class != prevClass && (!o.grp || o.rating != prevRating || o.mode)) {
|
||||||
list.push('<br/>');
|
list.push('<br/>');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ angular.module('app').directive('componentSelect', function () {
|
|||||||
|
|
||||||
list.push('</li>');
|
list.push('</li>');
|
||||||
prevClass = o.class;
|
prevClass = o.class;
|
||||||
|
prevRating= o.rating;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user