Fixing PR #112 as discussed with Arik

This commit is contained in:
Christopher Valles 2014-03-03 17:11:38 +00:00
parent 0822789002
commit 55cc3dd90e

View File

@ -83,7 +83,7 @@
var unwatch = scope.$watch('query', function(q) {
if (q && q.id) {
unwatch();
if (!scope.vis) {
scope.vis = {
'query_id': q.id,
@ -144,12 +144,12 @@
scope.submit = function() {
Visualization.save(scope.vis, function success(result) {
growl.addSuccessMessage("Visualization saved");
scope.vis = result;
var visIds = _.pluck(scope.query.visualizations, 'id');
var index = visIds.indexOf(result.id);
if (index > -1) {
scope.query.visualizations[index] = result;
} else {