mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix saving of top level panel properties
This commit is contained in:
parent
20b3a5d3f5
commit
11934adf1a
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'angular'
|
'angular',
|
||||||
|
'underscore'
|
||||||
],
|
],
|
||||||
function (angular) {
|
function (angular,_) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular
|
angular
|
||||||
@ -15,11 +16,15 @@ function (angular) {
|
|||||||
// re-render on show.
|
// re-render on show.
|
||||||
elem.bind('click',function(){
|
elem.bind('click',function(){
|
||||||
|
|
||||||
|
// Create a temp scope so we can discard changes to it if needed
|
||||||
var tmpScope = scope.$new();
|
var tmpScope = scope.$new();
|
||||||
tmpScope.panel = angular.copy(scope.panel);
|
tmpScope.panel = angular.copy(scope.panel);
|
||||||
|
|
||||||
tmpScope.editSave = function(panel) {
|
tmpScope.editSave = function(panel) {
|
||||||
scope.panel = panel;
|
// Correctly set the top level properties of the panel object
|
||||||
|
_.each(panel,function(v,k) {
|
||||||
|
scope.panel[k] = panel[k];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var panelModal = $modal({
|
var panelModal = $modal({
|
||||||
|
Loading…
Reference in New Issue
Block a user