From 2b5339193c5f801f01c8977984d664d812e222a2 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Mon, 12 Jun 2017 18:45:04 +0200 Subject: [PATCH] bring admin back --- www/poll/index.html | 1 + www/poll/main.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/www/poll/index.html b/www/poll/index.html index 22280e8a9..091086f5c 100644 --- a/www/poll/index.html +++ b/www/poll/index.html @@ -28,6 +28,7 @@
+
diff --git a/www/poll/main.js b/www/poll/main.js index 99419eb22..8043da3fc 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -141,10 +141,12 @@ define([ var setTablePublished = function (bool) { if (bool) { if (APP.$publish) { APP.$publish.hide(); } + if (APP.$admin) { APP.$admin.show(); } $('#create-option').hide(); $('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').hide(); } else { if (APP.$publish) { APP.$publish.show(); } + if (APP.$admin) { APP.$admin.hide(); } $('#create-option').show(); $('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').show(); } @@ -518,7 +520,11 @@ var ready = function (info, userid, readOnly) { publish(true); }); - // #publish button is removed in readonly + APP.$admin = $('#admin') + .click(function () { + publish(false); + }); + APP.$help = $('#help') .click(function () { showHelp(); @@ -723,7 +729,7 @@ var create = function (info) { }; if (readOnly) { - $('#commit, #create-user, #create-option, #publish').remove(); + $('#commit, #create-user, #create-option, #publish, #admin').remove(); } var parsedHash = Cryptpad.parsePadUrl(window.location.href);