prevent save when dialogs are open

This commit is contained in:
Mads Rasmussen
2018-11-02 13:47:45 +01:00
parent b3e5f59fe4
commit 66ea4105b0
2 changed files with 16 additions and 3 deletions

View File

@@ -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,

View File

@@ -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";