diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index f6f6591a6..5a833e477 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -422,7 +422,7 @@ img { color: black; text-align: center; padding: 5px; - z-index: 10000; + z-index: 1000001; display: none; border: 1px solid #d3d3d3; margin-left: -150px; diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 321eac017..ec7f697a5 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -583,10 +583,10 @@ angular.module('OpenSlidesApp.core.site', [ /* This Factory could be used in any dialog, if the user should be warned, if another user * also has this dialog open. Use it like in this example in any dialog controller: - var dialogClosedCallback = DialogEditingWarning.dialogOpened('dialog_name' + item.id); - $scope.$on('$destroy', dialogClosedCallback); + var editingStoppedCallback = EditingWarning.editingStarted('editing_name' + item.id); + $scope.$on('$destroy', editingStoppedCallback); */ -.factory('DialogEditingWarning', [ +.factory('EditingWarning', [ 'operator', 'gettextCatalog', 'Notify', @@ -595,7 +595,7 @@ angular.module('OpenSlidesApp.core.site', [ return { // This returns the callback function that the controller should call, if // the dialog got closed by the user. Provide a unique dialog name. - dialogOpened: function (dialogName) { + editingStarted: function (dialogName) { // List of active editors var editorNames = []; var messagingId = dialogName + 'EditingWarning'; diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 003f710d5..a5607778b 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -1191,10 +1191,12 @@ angular.module('OpenSlidesApp.motions.site', [ 'ProjectionDefault', 'MotionBlock', 'MotionPdfExport', + 'EditingWarning', function($scope, $http, $timeout, operator, ngDialog, gettextCatalog, MotionForm, ChangeRecommmendationCreate, ChangeRecommmendationView, MotionChangeRecommendation, Motion, MotionComment, Category, Mediafile, Tag, User, Workflow, Config, motionId, MotionInlineEditing, - MotionCommentsInlineEditing, Projector, ProjectionDefault, MotionBlock, MotionPdfExport) { + MotionCommentsInlineEditing, Projector, ProjectionDefault, MotionBlock, MotionPdfExport, + EditingWarning) { var motion = Motion.get(motionId); Category.bindAll({}, $scope, 'categories'); Mediafile.bindAll({}, $scope, 'mediafiles'); @@ -1490,6 +1492,18 @@ angular.module('OpenSlidesApp.motions.site', [ Config.get('motions_allow_disable_versioning').value); } ); + // Wrapper functions for $scope.inlineEditing, to warn other users. + var editingStoppedCallback; + $scope.enableMotionInlineEditing = function () { + editingStoppedCallback = EditingWarning.editingStarted('motion_update_' + motion.id); + $scope.inlineEditing.enable(); + }; + $scope.disableMotionInlineEditing = function () { + if (editingStoppedCallback) { + editingStoppedCallback(); + } + $scope.inlineEditing.disable(); + }; $scope.commentsInlineEditing = MotionCommentsInlineEditing.createInstances($scope, motion); $scope.personalNoteInlineEditing = MotionInlineEditing.createInstance($scope, motion, 'personal-note-inline-editor', false, @@ -1693,9 +1707,9 @@ angular.module('OpenSlidesApp.motions.site', [ 'AgendaUpdate', 'motionId', 'ErrorMessage', - 'DialogEditingWarning', + 'EditingWarning', function($scope, $state, Motion, Category, Config, Mediafile, MotionForm, - Tag, User, Workflow, Agenda, AgendaUpdate, motionId, ErrorMessage, DialogEditingWarning) { + Tag, User, Workflow, Agenda, AgendaUpdate, motionId, ErrorMessage, EditingWarning) { Category.bindAll({}, $scope, 'categories'); Mediafile.bindAll({}, $scope, 'mediafiles'); Tag.bindAll({}, $scope, 'tags'); @@ -1751,8 +1765,8 @@ angular.module('OpenSlidesApp.motions.site', [ } // Displaying a warning, if other users edit this motion too - var dialogClosedCallback = DialogEditingWarning.dialogOpened('motion_update_dialog_' + motionId); - $scope.$on('$destroy', dialogClosedCallback); + var editingStoppedCallback = EditingWarning.editingStarted('motion_update_' + motionId); + $scope.$on('$destroy', editingStoppedCallback); // Save motion $scope.save = function (motion, gotoDetailView) { diff --git a/openslides/motions/static/templates/motions/motion-detail/toolbar.html b/openslides/motions/static/templates/motions/motion-detail/toolbar.html index a7fa7e8fd..7541ba64c 100644 --- a/openslides/motions/static/templates/motions/motion-detail/toolbar.html +++ b/openslides/motions/static/templates/motions/motion-detail/toolbar.html @@ -2,12 +2,12 @@