From 383c2f54cb17c6a269a1a81d32c125163481a34c Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Thu, 5 Oct 2017 12:14:03 +0300 Subject: [PATCH] 1. Add a class cp-hidden-if-readonly which is display:none if the pad is in read-only mode. 2. Don't show color pickers or options when in read-only on presentation. --- customize.dist/src/less2/main.less | 2 ++ www/common/sframe-app-framework.js | 3 +++ www/slide/inner.js | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index 51450db27..ab75575c8 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -22,6 +22,8 @@ html.cp-app-print { .app-print_main(); } +body.cp-readonly .cp-hidden-if-readonly { display:none !important; } + body.cp-app-drive { @import "../../../drive/app-drive.less"; } body.cp-app-pad { @import "../../../pad/app-pad.less"; } body.cp-app-code { @import "../../../code/app-code.less"; } diff --git a/www/common/sframe-app-framework.js b/www/common/sframe-app-framework.js index 6b7bb34e2..738d1ab70 100644 --- a/www/common/sframe-app-framework.js +++ b/www/common/sframe-app-framework.js @@ -397,6 +397,8 @@ define([ }); }).nThen(function (waitFor) { + if (readOnly) { $('body').addClass('cp-readonly'); } + var done = waitFor(); var intr; var check = function () { @@ -443,6 +445,7 @@ define([ $toolbar: $(toolbarContainer) }; var $hist = common.createButton('history', true, {histConfig: histConfig}); + $hist.addClass('cp-hidden-if-readonly'); toolbar.$drawer.append($hist); if (!cpNfInner.metadataMgr.getPrivateData().isTemplate) { diff --git a/www/slide/inner.js b/www/slide/inner.js index 43b140df3..f32a33830 100644 --- a/www/slide/inner.js +++ b/www/slide/inner.js @@ -263,7 +263,7 @@ define([ var $slideOptions = $('