aboutsummaryrefslogtreecommitdiff
path: root/scripts/src/note-edit.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/src/note-edit.js')
-rw-r--r--scripts/src/note-edit.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/src/note-edit.js b/scripts/src/note-edit.js
index c8f3caa..5abbab7 100644
--- a/scripts/src/note-edit.js
+++ b/scripts/src/note-edit.js
@@ -82,13 +82,6 @@ function edit_note(btn, form, title, quill, qcontainer, url){
}
return false;
}
-function ajaxHijack(form, func) {
- form.onsubmit = function(e) {
- e.preventDefault();
- func(e.target);
- return false;
- }
-}
function notebookCreate(form) {
var request = new XMLHttpRequest();
var url = form.action
@@ -107,7 +100,9 @@ function notebookCreate(form) {
var select = document.getElementById('id_notebook');
var parentForm = document.getElementById('note-edit-form');
select.options.add(new Option(data['name'], data['id'], false, true));
- parentForm.formchange = true;
+ if (parentForm !== null) {
+ parentForm.formchange = true;
+ }
} else {
var data = JSON.parse(request.responseText);
console.log(data);
@@ -146,7 +141,7 @@ if (typeof(document.getElementById('note-edit-form')) != 'undefined' && document
form.addEventListener('input', function (e) {
form.formchange = true;
});
- //document.getElementById('btn-js-hide').classList.add('hide');
+ document.getElementById('btn-js-hide').classList.add('hide');
btn.classList.remove('hide');
btn.editing = false;
btn.addEventListener('click', function(e){