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
3c24e76eb4
commit
2bcb56d249
@ -282,6 +282,13 @@
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
unbind = $scope.$watch('selectedTab == "add"', function(newPanel) {
|
||||
if (newPanel && $routeParams.queryId == undefined) {
|
||||
unbind();
|
||||
$scope.saveQuery();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var QueriesCtrl = function($scope, $http, $location, $filter, Query) {
|
||||
|
@ -46,7 +46,7 @@
|
||||
}
|
||||
}]);
|
||||
|
||||
directives.directive('editVisulatizationForm', ['Visualization', 'growl', '$location', function(Visualization, growl, $location) {
|
||||
directives.directive('editVisulatizationForm', ['Visualization', 'growl', function(Visualization, growl) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: '/views/edit_visualization.html',
|
||||
@ -142,28 +142,6 @@
|
||||
};
|
||||
|
||||
scope.submit = function() {
|
||||
if (!scope.query.id) {
|
||||
scope.$parent.saveQuery(false, null, false);
|
||||
var unwatch = scope.$watch('query', function(q) {
|
||||
if (q && q.id) {
|
||||
unwatch();
|
||||
scope.vis['query_id'] = q.id;
|
||||
|
||||
scope.saveVisualization(false);
|
||||
|
||||
$location.path($location.path().replace('new', q.id)).replace();
|
||||
}
|
||||
}, true);
|
||||
} else {
|
||||
scope.saveVisualization();
|
||||
}
|
||||
};
|
||||
|
||||
scope.saveVisualization = function(updateTabs) {
|
||||
if (updateTabs == undefined) {
|
||||
updateTabs = true;
|
||||
}
|
||||
|
||||
Visualization.save(scope.vis, function success(result) {
|
||||
growl.addSuccessMessage("Visualization saved");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user