Skip to content

Commit

Permalink
Merge pull request #1639 from spenceralger/advanced_editting
Browse files Browse the repository at this point in the history
Improve ux when editing advanced config default
  • Loading branch information
w33ble committed Oct 10, 2014
2 parents 46a0815 + eecc21b commit 00326b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/kibana/apps/settings/sections/advanced/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ define(function (require) {
};

$scope.edit = function (conf) {
conf.unsavedValue = conf.value;
conf.unsavedValue = conf.value || conf.defVal;
$scope.configs.forEach(function (c) {
c.editting = (c === conf);
});
};

$scope.save = function (conf) {
loading(conf, function () {
if (conf.unsavedValue === conf.defVal) {
return config.clear(conf.name);
}

return config.set(conf.name, conf.unsavedValue);
});
};
Expand Down

0 comments on commit 00326b2

Please sign in to comment.