|
|
@ -2358,7 +2358,7 @@ define([
|
|
|
|
updateAddInline();
|
|
|
|
updateAddInline();
|
|
|
|
|
|
|
|
|
|
|
|
if (editable) {
|
|
|
|
if (editable) {
|
|
|
|
Sortable.create($container[0], {
|
|
|
|
APP.mainSortable = Sortable.create($container[0], {
|
|
|
|
direction: "vertical",
|
|
|
|
direction: "vertical",
|
|
|
|
filter: "input, button, .CodeMirror, .cp-form-type-sort",
|
|
|
|
filter: "input, button, .CodeMirror, .cp-form-type-sort",
|
|
|
|
preventOnFilter: false,
|
|
|
|
preventOnFilter: false,
|
|
|
@ -2413,6 +2413,23 @@ define([
|
|
|
|
var helpMenu = framework._.sfCommon.createHelpMenu(['text', 'pad']);
|
|
|
|
var helpMenu = framework._.sfCommon.createHelpMenu(['text', 'pad']);
|
|
|
|
$toolbarContainer.after(helpMenu.menu);
|
|
|
|
$toolbarContainer.after(helpMenu.menu);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var offlineEl = h('div.alert.alert-danger.cp-burn-after-reading', Messages.disconnected);
|
|
|
|
|
|
|
|
var oldFilter;
|
|
|
|
|
|
|
|
framework.onEditableChange(function (editable) {
|
|
|
|
|
|
|
|
if (editable) {
|
|
|
|
|
|
|
|
if (APP.mainSortable) { APP.mainSortable.options.filter = oldFilter; }
|
|
|
|
|
|
|
|
if (!APP.isEditor) { $(offlineEl).remove(); }
|
|
|
|
|
|
|
|
$body.removeClass('cp-readonly');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (APP.mainSortable) {
|
|
|
|
|
|
|
|
oldFilter = APP.mainSortable.options.filter;
|
|
|
|
|
|
|
|
APP.mainSortable.options.filter = function () { return true; };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!APP.isEditor) { $('.cp-help-container').before(offlineEl); }
|
|
|
|
|
|
|
|
$body.addClass('cp-readonly');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (!APP.isEditor) {
|
|
|
|
if (!APP.isEditor) {
|
|
|
|
framework._.toolbar.alone();
|
|
|
|
framework._.toolbar.alone();
|
|
|
|
}
|
|
|
|
}
|
|
|
|