prevent save when dialogs are open
This commit is contained in:
@@ -24,6 +24,18 @@
|
||||
return editors;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.services.editorService#getNumberOfEditors
|
||||
* @methodOf umbraco.services.editorService
|
||||
*
|
||||
* @description
|
||||
* Method to return the number of open editors
|
||||
*/
|
||||
function getNumberOfEditors() {
|
||||
return editors.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.services.editorService#open
|
||||
@@ -491,6 +503,7 @@
|
||||
|
||||
var service = {
|
||||
getEditors: getEditors,
|
||||
getNumberOfEditors: getNumberOfEditors,
|
||||
open: open,
|
||||
close: close,
|
||||
closeAll: closeAll,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function DocumentTypesEditController($scope, $routeParams, $injector, contentTypeResource, dataTypeResource, editorState, contentEditingHelper, formHelper, navigationService, iconHelper, contentTypeHelper, notificationsService, $filter, $q, localizationService, overlayHelper, eventsService, angularHelper) {
|
||||
function DocumentTypesEditController($scope, $routeParams, contentTypeResource, dataTypeResource, editorState, contentEditingHelper, formHelper, navigationService, iconHelper, contentTypeHelper, notificationsService, $q, localizationService, overlayHelper, eventsService, angularHelper, editorService) {
|
||||
|
||||
var vm = this;
|
||||
var evts = [];
|
||||
@@ -296,14 +296,14 @@
|
||||
/* ---------- SAVE ---------- */
|
||||
|
||||
function save() {
|
||||
saveInternal();
|
||||
saveInternal().then(angular.noop, angular.noop);
|
||||
}
|
||||
|
||||
/** This internal save method performs the actual saving and returns a promise, not to be bound to any buttons but used by other bound methods */
|
||||
function saveInternal() {
|
||||
|
||||
// only save if there is no overlays open
|
||||
if (overlayHelper.getNumberOfOverlays() === 0) {
|
||||
if (overlayHelper.getNumberOfOverlays() === 0 && editorService.getNumberOfEditors() === 0) {
|
||||
|
||||
vm.page.saveButtonState = "busy";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user