mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Remove TinyMCE draft auto init functionality [SCI-7729]
This commit is contained in:
parent
2ffec1cf49
commit
b559352128
4 changed files with 1 additions and 18 deletions
|
@ -18,7 +18,6 @@ function initEditMyModuleDescription() {
|
|||
if ($(this).hasClass('record-info-link')) return;
|
||||
e.stopPropagation();
|
||||
});
|
||||
TinyMCE.initIfHasDraft(viewObject);
|
||||
}
|
||||
|
||||
function initEditProtocolDescription() {
|
||||
|
@ -30,7 +29,6 @@ function initEditProtocolDescription() {
|
|||
if ($(this).hasClass('record-info-link')) return;
|
||||
e.stopPropagation();
|
||||
});
|
||||
TinyMCE.initIfHasDraft(viewObject);
|
||||
}
|
||||
|
||||
function initCopyToRepository() {
|
||||
|
|
|
@ -140,7 +140,6 @@
|
|||
function processResult(ev, resultTypeEnum) {
|
||||
var $form = $(ev.target.form);
|
||||
$form.clearFormErrors();
|
||||
|
||||
textValidator(ev, $form.find('#result_name'), 0, GLOBAL_CONSTANTS.NAME_MAX_LENGTH);
|
||||
|
||||
switch (resultTypeEnum) {
|
||||
|
|
|
@ -29,7 +29,6 @@ var ProtocolRepositoryHeader = (function() {
|
|||
if ($(this).hasClass('record-info-link')) return;
|
||||
e.stopPropagation();
|
||||
});
|
||||
TinyMCE.initIfHasDraft(viewObject);
|
||||
}
|
||||
|
||||
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);
|
||||
},
|
||||
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);
|
||||
}
|
||||
}
|
||||
highlight: initHighlightjs
|
||||
};
|
||||
})();
|
||||
|
||||
|
|
Loading…
Reference in a new issue