Page mode by default in rich text

This commit is contained in:
yflory
2020-04-20 11:56:12 +02:00
parent ca9f874afb
commit 41c0704ad8
4 changed files with 25 additions and 2 deletions

View File

@@ -731,10 +731,30 @@ define([
$iframe.find('body').attr('spellcheck', true);
}
});
Messages.pad_useFullWidth = "Use full width"; // XXX
Messages.pad_usePageWidth = "Use page mode"; // XXX
framework._.sfCommon.getAttribute(['pad', 'width'], function (err, data) {
if (data) {
var active = data || typeof(data) === "undefined";
if (active) {
$iframe.find('html').addClass('cke_body_width');
}
var $width = framework._.sfCommon.createButton('', true, {
icon: 'fa-arrows-h',
text: active ? Messages.pad_useFullWidth : Messages.pad_usePageWidth,
name: "pad-width",
},function () {
if (active) {
$iframe.find('html').removeClass('cke_body_width');
} else {
$iframe.find('html').addClass('cke_body_width');
}
active = !active;
var key = active ? Messages.pad_useFullWidth : Messages.pad_usePageWidth;
$width.find('.cp-toolbar-drawer-element').text(key);
framework._.sfCommon.setAttribute(['pad', 'width'], active);
});
framework._.toolbar.$drawer.append($width);
});
framework._.sfCommon.isPadStored(function (err, val) {