From 690621000e27ae90c758571871abfaddb99afd2c Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 7 Apr 2021 18:03:37 +0200 Subject: [PATCH] Add properties modal to calendars --- www/calendar/inner.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/www/calendar/inner.js b/www/calendar/inner.js index d4aa9ffb6..c1eff9665 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -398,7 +398,6 @@ Messages.calendar_import = "Import to my calendars"; content: h('span', Messages.accessButton), action: function (e) { e.stopPropagation(); - var friends = common.getFriends(); var cal = APP.calendars[id]; var title = Util.find(cal, ['content', 'metadata', 'title']); var color = Util.find(cal, ['content', 'metadata', 'color']); @@ -420,6 +419,33 @@ Messages.calendar_import = "Import to my calendars"; return true; } }); + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-info-circle', + }, + content: h('span', Messages.propertiesButton), + action: function (e) { + e.stopPropagation(); + var friends = common.getFriends(); + var cal = APP.calendars[id]; + var title = Util.find(cal, ['content', 'metadata', 'title']); + var color = Util.find(cal, ['content', 'metadata', 'color']); + var h = cal.hashes || {}; + var href = Hash.hashToHref(h.editHash || h.viewHash, 'calendar'); + Properties.getPropertiesModal(common, { + calendar: { + title: title, + color: color, + channel: id, + }, + common: common, + channel: id, + href: href + }); + return true; + } + }); } if (!cantRemove) { options.push({