]> lifelog.hopto.org Git - LifeLog.git/commitdiff
html meta id returned string parts.
authorWill Budic <redacted>
Mon, 2 Mar 2020 09:36:37 +0000 (20:36 +1100)
committerWill Budic <redacted>
Mon, 2 Mar 2020 09:36:37 +0000 (20:36 +1100)
htdocs/cgi-bin/wsrc/main.js

index dab45f6c53898f0f250790b4f90e545f54b2a8b7..d1e5a79c13e3e8b5680ef214a746deba33ffb205 100644 (file)
@@ -228,7 +228,6 @@ function onBodyLoad(toggle, tz, today, expires, rs_cur) {
         var lbl = $(e.target).text();
         lbl = lbl.replace(/\s*$/g, "");
         lbl = lbl + "&nbsp;".repeat(16-lbl.length);
-        //$("#ec option:contains(" + lbl + ")").prop('selected', true);
         $("#lcat_v").html(lbl);
         $("#vc").val(ci);
         $("#cat_desc").show();
@@ -249,7 +248,6 @@ function onBodyLoad(toggle, tz, today, expires, rs_cur) {
         var lbl = $(e.target).text();
         lbl = lbl.replace(/\s*$/g, "");
         lbl = lbl + "&nbsp;".repeat(16-lbl.length);
-        //$("#ec option:contains(" + lbl + ")").prop('selected', true);
         $("#lcat_x").html(lbl);
         $("#xc").val(ci);
         $("#cat_desc").show();
@@ -445,8 +443,9 @@ function edit(row) {
 
     //Select category
     var ec_lb = $("#c" + row).text();
-    var ec_id = $("meta[name='"+ec_lb+"]']").attr('id');
-    //$("#ec option:contains(" + ec_v + ")").prop('selected', true);
+    var ec_id = $("meta[name='"+ec_lb+"']").attr('id');
+    ec_id = ec_id.replace(/^cats\[/g,'');
+    ec_id = ec_id.replace(/\]$/g,'');
     $("#lcat").html(ec_lb);
     $("#ec").val(ec_id);