Offloading options fix

- count of showing nodes limited by 2

Closes-Bug: #1528224

Change-Id: I2ac9228ac7d222485ec4c1f355de0e3825daf04b
This commit is contained in:
Kate Pimenova 2015-12-21 18:57:30 +03:00 committed by Vitaly Kramskikh
parent d9011bd2ae
commit c691acb4b9
1 changed files with 5 additions and 2 deletions

View File

@ -107,13 +107,16 @@ function($, _, React, i18n, utils) {
var lastState,
added = 0,
excerpt = ifcModes.map(
excerpt = [];
_.each(ifcModes,
(mode) => {
if (!_.isNull(mode.state) && mode.state !== lastState) {
lastState = mode.state;
added++;
return (added > 1 ? ', ' : '') + mode.name + ' ' + states[mode.state];
excerpt.push((added > 1 ? ', ' : '') + mode.name + ' ' + states[mode.state]);
}
// show no more than two modes in the button
if (added == 2) return false;
}
);
if (added < ifcModes.length) excerpt.push(', ...');