From 70eec175557a58644ce5415c66080f87d62e5d9d Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 8 Nov 2020 17:39:01 +0100 Subject: [PATCH] fix changing map ownership broken cf #780 --- umap/static/umap/js/umap.permissions.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.permissions.js b/umap/static/umap/js/umap.permissions.js index be7f9d51..6d6cc977 100644 --- a/umap/static/umap/js/umap.permissions.js +++ b/umap/static/umap/js/umap.permissions.js @@ -36,11 +36,11 @@ L.U.MapPermissions = L.Class.extend({ }, isOwner: function () { - return this.map.options.user && this.options.owner && this.map.options.user.id == this.options.owner.id; + return this.map.options.user && this.map.options.permissions.owner && this.map.options.user.id == this.map.options.permissions.owner.id; }, isAnonymousMap: function () { - return !this.options.owner; + return !this.map.options.permissions.owner; }, getMap: function () { @@ -111,6 +111,7 @@ L.U.MapPermissions = L.Class.extend({ data: formData, context: this, callback: function (data) { + this.commit(); this.isDirty = false; this.map.continueSaving(); } @@ -133,6 +134,10 @@ L.U.MapPermissions = L.Class.extend({ owner.textContent = this.options.owner.name; ownerContainer.appendChild(owner); } + }, + + commit: function () { + L.Util.extend(this.map.options.permissions, this.options); } });