mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Remove TinyMCE draft auto init functionality [SCI-7729]
This commit is contained in:
parent
2ffec1cf49
commit
b559352128
|
@ -18,7 +18,6 @@ function initEditMyModuleDescription() {
|
||||||
if ($(this).hasClass('record-info-link')) return;
|
if ($(this).hasClass('record-info-link')) return;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
TinyMCE.initIfHasDraft(viewObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initEditProtocolDescription() {
|
function initEditProtocolDescription() {
|
||||||
|
@ -30,7 +29,6 @@ function initEditProtocolDescription() {
|
||||||
if ($(this).hasClass('record-info-link')) return;
|
if ($(this).hasClass('record-info-link')) return;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
TinyMCE.initIfHasDraft(viewObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initCopyToRepository() {
|
function initCopyToRepository() {
|
||||||
|
|
|
@ -140,7 +140,6 @@
|
||||||
function processResult(ev, resultTypeEnum) {
|
function processResult(ev, resultTypeEnum) {
|
||||||
var $form = $(ev.target.form);
|
var $form = $(ev.target.form);
|
||||||
$form.clearFormErrors();
|
$form.clearFormErrors();
|
||||||
|
|
||||||
textValidator(ev, $form.find('#result_name'), 0, GLOBAL_CONSTANTS.NAME_MAX_LENGTH);
|
textValidator(ev, $form.find('#result_name'), 0, GLOBAL_CONSTANTS.NAME_MAX_LENGTH);
|
||||||
|
|
||||||
switch (resultTypeEnum) {
|
switch (resultTypeEnum) {
|
||||||
|
|
|
@ -29,7 +29,6 @@ var ProtocolRepositoryHeader = (function() {
|
||||||
if ($(this).hasClass('record-info-link')) return;
|
if ($(this).hasClass('record-info-link')) return;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
TinyMCE.initIfHasDraft(viewObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
15
app/javascript/packs/tiny_mce.js
vendored
15
app/javascript/packs/tiny_mce.js
vendored
|
@ -456,20 +456,7 @@ window.TinyMCE = (() => {
|
||||||
makeItDirty: (editor) => {
|
makeItDirty: (editor) => {
|
||||||
makeItDirty(editor);
|
makeItDirty(editor);
|
||||||
},
|
},
|
||||||
highlight: initHighlightjs,
|
highlight: initHighlightjs
|
||||||
initIfHasDraft: (viewObject) => {
|
|
||||||
const storedDrafts = sessionStorage.getItem(draftLocation());
|
|
||||||
const draftName = viewObject.data('tinymce-init');
|
|
||||||
if (storedDrafts && JSON.parse(storedDrafts)[0] === draftName) {
|
|
||||||
const top = viewObject.offset().top;
|
|
||||||
setTimeout(() => {
|
|
||||||
viewObject.click();
|
|
||||||
}, 0);
|
|
||||||
setTimeout(() => {
|
|
||||||
window.scrollTo(0, top - 150);
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue