From 5e8b183ee68e8a87d7c7ddae9ba66487dbbddd31 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 22 Dec 2017 14:42:37 +0100 Subject: [PATCH] Fix uncommited column in poll hidden in published mode --- www/poll/app-poll.less | 10 ++++++---- www/poll/inner.js | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/www/poll/app-poll.less b/www/poll/app-poll.less index 88bcd5f45..88839f96e 100644 --- a/www/poll/app-poll.less +++ b/www/poll/app-poll.less @@ -57,7 +57,7 @@ overflow-x: hidden; #cp-app-poll-form { flex: 1; overflow-y: auto; - &.cp-app-poll-published { + &.cp-app-poll-readonly { #cp-app-poll-table-scroll { max-width: ~"calc(75% - 30px - 100px)"; } @@ -67,13 +67,15 @@ overflow-x: hidden; table tr td:last-child { margin-left: 0; // uncommitted is hidden } - #cp-app-poll-create-option { + td.cp-app-poll-table-uncommitted { display: none; } - .cp-app-poll-table-remove[data-rt-id^="y"], .cp-app-poll-table-edit[data-rt-id^="y"] { + } + &.cp-app-poll-published { + #cp-app-poll-create-option { display: none; } - td.cp-app-poll-table-uncommitted { + .cp-app-poll-table-remove[data-rt-id^="y"], .cp-app-poll-table-edit[data-rt-id^="y"] { display: none; } tr.cp-app-poll-table-uncommitted { diff --git a/www/poll/inner.js b/www/poll/inner.js index dcc337d17..c693a643d 100644 --- a/www/poll/inner.js +++ b/www/poll/inner.js @@ -1188,6 +1188,10 @@ define([ APP.loggedIn = common.isLoggedIn(); APP.SFCommon = common; + if (APP.readOnly) { + $('#cp-app-poll-form').addClass('cp-app-poll-readonly'); + } + APP.origin = common.getMetadataMgr().getPrivateData().origin; APP.$body = $('body');