From 5a7839ceaadb317494f2a30388916cf55ef1427f Mon Sep 17 00:00:00 2001 From: banglashi Date: Mon, 23 Nov 2020 12:10:35 +0100 Subject: [PATCH] allow to lock own artefacts as an editor (#132) * allow to lock own artefacts as an editor --- public/javascripts/spacedeck_sections.js | 14 +++++++++++--- views/partials/tool/object-options.html | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/public/javascripts/spacedeck_sections.js b/public/javascripts/spacedeck_sections.js index 3ca372a..4537434 100644 --- a/public/javascripts/spacedeck_sections.js +++ b/public/javascripts/spacedeck_sections.js @@ -182,7 +182,8 @@ var SpacedeckSections = { toolbar_props_in: false, toolbar_artifacts_x: "-1000px", toolbar_artifacts_y: "-1000px", - toolbar_artifacts_in: true + toolbar_artifacts_in: true, + toolbar_lock_in: false }, methods: { @@ -848,7 +849,7 @@ var SpacedeckSections = { if (!a) return false; if (!this.active_space) return false; - if (this.active_space_role=="viewer" || (a.locked && this.active_space_role!="admin")) { + if (this.active_space_role=="viewer" || (a.locked && this.active_space_role=="viewer")) { return false; } @@ -2526,11 +2527,18 @@ var SpacedeckSections = { }, show_toolbar_props: function() { - if (this.selection_metrics.count==0) return; + if (this.selection_metrics.count==0) { + this.toolbar_lock_in = false; + return; + } arts = this.selected_artifacts(); + // check if selected artifacts are all from the same user + let same_user = true; for (var i=0;i - -