From 11934adf1a17ae9bf549dfddfcc21f71eb28a2a2 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 27 Dec 2013 08:03:38 -0700 Subject: [PATCH] Fix saving of top level panel properties --- src/app/directives/configModal.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/directives/configModal.js b/src/app/directives/configModal.js index 49516056e01..12036ee8304 100644 --- a/src/app/directives/configModal.js +++ b/src/app/directives/configModal.js @@ -1,7 +1,8 @@ define([ - 'angular' + 'angular', + 'underscore' ], -function (angular) { +function (angular,_) { 'use strict'; angular @@ -15,11 +16,15 @@ function (angular) { // re-render on show. elem.bind('click',function(){ + // Create a temp scope so we can discard changes to it if needed var tmpScope = scope.$new(); tmpScope.panel = angular.copy(scope.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({