Merge file upload and image embed button in whiteboard

This commit is contained in:
yflory 2020-05-14 11:11:13 +02:00
parent f27f0838cf
commit 09323e38fa
2 changed files with 17 additions and 16 deletions

View File

@ -512,11 +512,6 @@
.cp-toolbar-title-hoverable {
width: 100%;
}
.cp-toolbar-title-value-page {
padding: 5px;
line-height: unset;
border: 0;
}
.cp-toolbar-title-editable, .cp-toolbar-title-value-page {
max-width: ~"calc(100vw - 26px)";
display: inline-block;
@ -527,6 +522,11 @@
box-sizing: border-box;
line-height: @toolbar_line-height;
}
.cp-toolbar-title-value-page {
padding: 5px;
line-height: @toolbar_line-height - 10px;
border: 0;
}
.cp-toolbar-title-edit, .cp-toolbar-title-save {
box-sizing: border-box;
height: @toolbar_line-height;
@ -1029,7 +1029,7 @@
.cp-toolbar-appmenu {
order: 3;
}
.cp-toolbar-mediatag {
.cp-toolbar-mediatag, .cp-toolbar-icon-mediatag {
order: 5;
}
.cp-toolbar-tools {

View File

@ -368,16 +368,6 @@ define([
reader.readAsDataURL(file);
};
Messages.canvas_insertImage = "Insert local image"; // XXX
framework._.sfCommon.createButton('', true, {
title: Messages.canvas_imageEmbed,
text: Messages.canvas_insertImage,
icon: 'fa-upload',
name: 'embedImage'
}).click(function () {
$('<input>', {type:'file'}).on('change', onUpload).click();
}).appendTo($drawer);
if (framework._.sfCommon.isLoggedIn()) {
framework.setMediaTagEmbedder(function ($mt) {
framework._.sfCommon.displayMediatagImage($mt, function (err, $image) {
@ -400,6 +390,17 @@ define([
APP.upload(name);
});
}).appendTo($drawer);
} else {
Messages.toolbar_insert = "Insert"; // XXX duplicate key from common-ui-elements
framework._.sfCommon.createButton('', true, {
title: Messages.canvas_imageEmbed,
text: Messages.toolbar_insert,
drawer: false,
icon: 'fa-picture-o',
name: 'mediatag'
}).click(function () {
$('<input>', {type:'file'}).on('change', onUpload).click();
}).appendTo(framework._.toolbar.$bottomL);
}
if (framework.isReadOnly()) {