Trying to make progres on persisting selection state, restoring selection state for new multi variable dropdown, proving to be really complex

This commit is contained in:
Torkel Ödegaard
2015-06-01 10:43:25 +02:00
parent f48d0fcb13
commit b5a846154a
4 changed files with 79 additions and 50 deletions

View File

@@ -130,6 +130,10 @@ function (angular, _, kbn) {
// if parameter has current value
// if it exists in options array keep value
if (variable.current) {
// if current value is an array do not do anything
if (_.isArray(variable.current.value)) {
return $q.when([]);
}
var currentOption = _.findWhere(variable.options, { text: variable.current.text });
if (currentOption) {
return self.setVariableValue(variable, currentOption);