From: Metabox Date: Tue, 23 Jul 2019 00:49:36 +0000 (+1000) Subject: fix, JQ not suitable for DOM attribute settings. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=89162f1e4d3c2d5bc385944d713ab334cf0fae7f;p=LifeLog.git fix, JQ not suitable for DOM attribute settings. --- diff --git a/htdocs/cgi-bin/wsrc/main.js b/htdocs/cgi-bin/wsrc/main.js index 4cf5e25..0f8846f 100644 --- a/htdocs/cgi-bin/wsrc/main.js +++ b/htdocs/cgi-bin/wsrc/main.js @@ -117,19 +117,20 @@ function loadedBody(toggle) { $("#RTF").prop("checked", false); // $('#tbl_doc').toggle(); // $('#toolbar-container').toggle(); - QUILL = new Quill('#editor-container', { - modules: { - formula: true, - syntax: true, - toolbar: '#toolbar-container' - }, - placeholder: 'Enter your Document here...', - theme: 'snow' - }); - Delta = Quill.import('delta'); - CHANGE = new Delta(); - // toggleDocument(); - + if ($('#editor-container').length) { + QUILL = new Quill('#editor-container', { + modules: { + formula: true, + syntax: true, + toolbar: '#toolbar-container' + }, + placeholder: 'Enter your Document here...', + theme: 'snow' + }); + Delta = Quill.import('delta'); + CHANGE = new Delta(); + // toggleDocument(); + } } @@ -484,14 +485,14 @@ function viewByDate(btn) { function submitNewCategory() { - var frm = $("#frm_config"); + var frm = document.getElementById("frm_config"); var cid = frm.caid; - frm.cchg.vak(cid.value); + frm.cchg.value = cid.value; return true; } function dateDiffSelected() { - $("#datediff").value = 1; + document.getElementById("datediff").value = 1; return true; }