Fix drag after adding a question

pull/1/head
yflory 4 years ago
parent eaa02bb8b8
commit 2de7c61284

@ -2283,7 +2283,7 @@ define([
filter: "input, button, .CodeMirror, .cp-form-type-sort",
preventOnFilter: false,
draggable: ".cp-form-block",
forceFallback: true,
//forceFallback: true,
fallbackTolerance: 5,
onStart: function () {
$container.find('.cp-form-creator-add-inline').remove();
@ -2334,17 +2334,17 @@ define([
$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.mainSortable) {
APP.mainSortable.options.disabled = false;
}
if (!APP.isEditor) { $(offlineEl).remove(); }
$body.removeClass('cp-form-readonly');
$('.cp-form-creator-settings').find('input, button').removeAttr('disabled');
} else {
if (APP.mainSortable) {
oldFilter = APP.mainSortable.options.filter;
APP.mainSortable.options.filter = function () { return true; };
APP.mainSortable.options.disabled = true;
}
if (!APP.isEditor) { $('.cp-help-container').before(offlineEl); }
$body.addClass('cp-form-readonly');

Loading…
Cancel
Save