mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 09:28:51 +00:00
Fixing PR #112 as discussed with Arik
This commit is contained in:
parent
0822789002
commit
55cc3dd90e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user