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.

This commit is contained in:
Caleb James DeLisle 2017-10-05 12:14:03 +03:00
parent d6570ad9f2
commit 383c2f54cb
3 changed files with 8 additions and 3 deletions

View file

@ -22,6 +22,8 @@ html.cp-app-print {
.app-print_main(); .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-drive { @import "../../../drive/app-drive.less"; }
body.cp-app-pad { @import "../../../pad/app-pad.less"; } body.cp-app-pad { @import "../../../pad/app-pad.less"; }
body.cp-app-code { @import "../../../code/app-code.less"; } body.cp-app-code { @import "../../../code/app-code.less"; }

View file

@ -397,6 +397,8 @@ define([
}); });
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
if (readOnly) { $('body').addClass('cp-readonly'); }
var done = waitFor(); var done = waitFor();
var intr; var intr;
var check = function () { var check = function () {
@ -443,6 +445,7 @@ define([
$toolbar: $(toolbarContainer) $toolbar: $(toolbarContainer)
}; };
var $hist = common.createButton('history', true, {histConfig: histConfig}); var $hist = common.createButton('history', true, {histConfig: histConfig});
$hist.addClass('cp-hidden-if-readonly');
toolbar.$drawer.append($hist); toolbar.$drawer.append($hist);
if (!cpNfInner.metadataMgr.getPrivateData().isTemplate) { if (!cpNfInner.metadataMgr.getPrivateData().isTemplate) {

View file

@ -263,7 +263,7 @@ define([
var $slideOptions = $('<button>', { var $slideOptions = $('<button>', {
title: Messages.slideOptionsTitle, title: Messages.slideOptionsTitle,
'class': 'cp-toolbar-rightside-button fa fa-cog', 'class': 'cp-toolbar-rightside-button fa fa-cog cp-hidden-if-readonly',
style: 'font-size: 17px' style: 'font-size: 17px'
}).click(function () { }).click(function () {
$('body').append(createPrintDialog()); $('body').append(createPrintDialog());
@ -307,13 +307,13 @@ define([
var $back = $('<button>', { var $back = $('<button>', {
id: SLIDE_BACKCOLOR_ID, id: SLIDE_BACKCOLOR_ID,
'class': 'fa fa-square cp-toolbar-rightside-button', 'class': 'fa fa-square cp-toolbar-rightside-button cp-hidden-if-readonly',
'style': 'font-family: FontAwesome; color: #000;', 'style': 'font-family: FontAwesome; color: #000;',
title: Messages.backgroundButtonTitle title: Messages.backgroundButtonTitle
}); });
var $text = $('<button>', { var $text = $('<button>', {
id: SLIDE_COLOR_ID, id: SLIDE_COLOR_ID,
'class': 'fa fa-i-cursor cp-toolbar-rightside-button', 'class': 'fa fa-i-cursor cp-toolbar-rightside-button cp-hidden-if-readonly',
'style': 'font-family: FontAwesome; font-weight: bold; color: #fff;', 'style': 'font-family: FontAwesome; font-weight: bold; color: #fff;',
title: Messages.colorButtonTitle title: Messages.colorButtonTitle
}); });