Save the state of CKEditor's toolbar (visible or hidden)
This commit is contained in:
parent
5bf966633c
commit
757d0a2800
@ -548,10 +548,9 @@ define([
|
|||||||
// Expand / collapse the toolbar
|
// Expand / collapse the toolbar
|
||||||
var $collapse = common.createButton(null, true);
|
var $collapse = common.createButton(null, true);
|
||||||
$collapse.removeClass('fa-question');
|
$collapse.removeClass('fa-question');
|
||||||
var updateIcon = function () {
|
var updateIcon = function (isVisible, force) {
|
||||||
$collapse.removeClass('fa-caret-down').removeClass('fa-caret-up');
|
$collapse.removeClass('fa-caret-down').removeClass('fa-caret-up');
|
||||||
var isCollapsed = !$bar.find('.cke_toolbox_main').is(':visible');
|
if (!isVisible) {
|
||||||
if (isCollapsed) {
|
|
||||||
if (!initializing) { common.feedback('HIDETOOLBAR_PAD'); }
|
if (!initializing) { common.feedback('HIDETOOLBAR_PAD'); }
|
||||||
$collapse.addClass('fa-caret-down');
|
$collapse.addClass('fa-caret-down');
|
||||||
}
|
}
|
||||||
@ -565,7 +564,18 @@ define([
|
|||||||
$(window).trigger('resize');
|
$(window).trigger('resize');
|
||||||
$('.cke_toolbox_main').toggle();
|
$('.cke_toolbox_main').toggle();
|
||||||
$(window).trigger('cryptpad-ck-toolbar');
|
$(window).trigger('cryptpad-ck-toolbar');
|
||||||
updateIcon();
|
var isVisible = $bar.find('.cke_toolbox_main').is(':visible');
|
||||||
|
common.setAttribute(['pad', 'showToolbar'], isVisible);
|
||||||
|
updateIcon(isVisible);
|
||||||
|
});
|
||||||
|
common.getAttribute(['pad', 'showToolbar'], function (err, data) {
|
||||||
|
if (typeof(data) === "undefined" || data) {
|
||||||
|
$('.cke_toolbox_main').show();
|
||||||
|
updateIcon(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('.cke_toolbox_main').hide();
|
||||||
|
updateIcon(false);
|
||||||
});
|
});
|
||||||
$rightside.append($collapse);
|
$rightside.append($collapse);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user