diff --git a/public/modules/forms/admin/directives/edit-form.client.directive.js b/public/modules/forms/admin/directives/edit-form.client.directive.js index 1889d39f..e1992192 100644 --- a/public/modules/forms/admin/directives/edit-form.client.directive.js +++ b/public/modules/forms/admin/directives/edit-form.client.directive.js @@ -24,7 +24,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField forceHelperSize: true, forcePlaceholderSize: true, update: function(e, ui) { - $rootScope.update(false, $scope.myform, true, false, function(err){ + $scope.update(false, $scope.myform, true, false, function(err){ }); }, }; @@ -336,7 +336,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField // Delete particular field on button click $scope.deleteField = function (field_index) { $scope.myform.form_fields.splice(field_index, 1); - $rootScope.update(false, $scope.myform, false, true, null); + $scope.update(false, $scope.myform, false, true, null); }; $scope.duplicateField = function(field_index){ @@ -346,7 +346,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField //Insert field at selected index $scope.myform.form_fields.push(currField); - $rootScope.update(false, $scope.myform, false, true, null); + $scope.update(false, $scope.myform, false, true, null); }; //Populate AddField with all available form field types diff --git a/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js b/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js index c9ba87a3..ba92adaf 100644 --- a/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js +++ b/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js @@ -60,22 +60,13 @@ var newFakeModal = function(){ var result = { opened: true, - result: { - then: function(confirmCallback, cancelCallback) { - //Store the callbacks for later when the user clicks on the OK or Cancel button of the dialog - this.confirmCallBack = confirmCallback; - this.cancelCallback = cancelCallback; - } - }, close: function( item ) { //The user clicked OK on the modal dialog, call the stored confirm callback with the selected item this.opened = false; - this.result.confirmCallBack( item ); }, dismiss: function( type ) { //The user clicked cancel on the modal dialog, call the stored cancel callback this.opened = false; - this.result.cancelCallback( type ); } }; return result; @@ -173,7 +164,6 @@ beforeEach(inject(function($uibModal) { var modal = newFakeModal(); spyOn($uibModal, 'open').and.returnValue(modal); - //spyOn($uibModal, 'close').and.callFake(modal.close()); })); // The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).