more work on repeating row

This commit is contained in:
Torkel Ödegaard
2015-03-20 13:33:52 -04:00
parent c7b4041879
commit 86e9d2cf07
2 changed files with 12 additions and 5 deletions
+2 -4
View File
@@ -102,7 +102,6 @@ function (angular, app, _, $) {
scope.selectorOpen = true;
scope.giveFocus = 1;
scope.oldCurrentText = variable.current.text;
var currentValues = variable.current.value;
if (_.isString(currentValues)) {
@@ -110,11 +109,10 @@ function (angular, app, _, $) {
}
scope.options = _.map(variable.options, function(option) {
var op = {text: option.text, value: option.value};
if (_.indexOf(currentValues, option.value) >= 0) {
op.selected = true;
option.selected = true;
}
return op;
return option;
});
$timeout(function() {
@@ -10,6 +10,7 @@ function (angular, _) {
module.service('dynamicDashboardSrv', function() {
this.init = function(dashboard) {
this.removeLinkedPanels(dashboard);
this.handlePanelRepeats(dashboard);
};
@@ -25,6 +26,7 @@ function (angular, _) {
for (j = 0; j < row.panels.length; j++) {
panel = row.panels[j];
if (panel.linked) {
console.log('removing panel: ' + panel.id);
row.panels = _.without(row.panels, panel);
j = j - 1;
}
@@ -52,7 +54,14 @@ function (angular, _) {
return;
}
_.each(variable.options, function(option, index) {
var selected;
if (variable.current.text === 'All') {
selected = variable.options.slice(1, variable.options.length);
} else {
selected = _.filter(variable.options, {selected: true});
}
_.each(selected, function(option, index) {
if (index > 0) {
var copy = dashboard.duplicatePanel(panel, row);
copy.repeat = null;