From 591d152c9f162157c53088a9ea0fbfb95842f9f2 Mon Sep 17 00:00:00 2001 From: Nicolas Sanchez Date: Fri, 10 Mar 2023 16:45:22 +0100 Subject: [PATCH] correction erreur bouton consultation simple --- db/db.sqlite3 | Bin 217088 -> 217088 bytes static/modules/md.js | 20 +++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/db/db.sqlite3 b/db/db.sqlite3 index 5ace3b6843050f0f2d376b42502c5c7cf2e94fab..074112033e7f91232baebe61a4f3a5eafda94fdc 100644 GIT binary patch delta 406 zcmZozz}v8ZcY-wIlZi6Uj88TuEad0sQ(<6XyvD$NjC%@)5aYG&0tURTju%+RW%MfxpRMn*k$Z12<4Wg1-%<&U8A@21Z@x9{#q? zg$l0xg8aPhy1lg3CO$<(MgebRo$A|4i22?owvoVKhIY+pAvahIySGQxn z$;i^;(ipk@=P^b;PDaM*92XcD3kvYh;yl4Ri)9P{4fdt%+c}c9@43L}$f9>!kVRUQ zDJ3;6u{5WoB(=DN;gAT6v@}z4X=ZU|UMiGgxRof&BCXFj{k%1^#B}GYjD?IE+qYh2 zT*V~C#^@x*A}tRyA~!QHQ#U<7Cyn83d*uzr?Ugr}I>H6nr!%my)-iA-u}8BXWvyd2 z+t{eWyjfV(g9*vilcUA$8TF<+o@CUTZhMk(?&c(kdF(vAAV0HD0(zBw(#FO%c97qq UL4I>#V(C$8jM{$hB%=}=0Dbjy_5c6? delta 434 zcmZozz}v8ZcY-wIrHL}mjF&bhEac~BpU%L<9?ig!#2(Em%qqOGk(qV7nK82m)AVR_ zW_!ld(;ZJTYOyp*Hade?Gq)#MFwbM>VSoS$AZ0q4Mm0V87r zH-9gK1b-t)o$Pd;4UD?X?fi|K3l%*0`Is7AfTAXiia?UJWcsB2j740`Y+o5TZ*khP zecjmjoQG?TniLxxx`izs$OG`|5 zzRFn0D7<~^RmN3JOtOrV9|(#wI<;5cVBB7LgQ+8&ALKa3YYcoU+{d`5a0qP{5D?*G zZjMacE_0OeCZiB9&l3h_W;F)>bDT-cY9P3=QIL_7=Lr)to3vFHeu Gne+gqsCVB0 diff --git a/static/modules/md.js b/static/modules/md.js index dfdb329..833704f 100644 --- a/static/modules/md.js +++ b/static/modules/md.js @@ -1,5 +1,15 @@ import { saveSelection, loadSelection } from "./caret.js"; +function setEditable() { + let editModeButton = document.getElementById('editModeButton'); + let cheezenotes = document.getElementById('cheezenotes'); + if (editModeButton.classList.contains('buttonoff')) { + cheezenotes.contentEditable = false; + } else { + cheezenotes.contentEditable = true; + } +} + function load(textarea, div) { div.innerHTML = ''; let lines = textarea.value.split('\n'); @@ -89,7 +99,7 @@ function onlink(e) { let cheezenotes = document.getElementById('cheezenotes'); if (cheezenotes.contentEditable == 'false') { e.preventDefault(); - cheezenotes.contentEditable = true; + setEditable(); let link = e.currentTarget; if (link.host !== document.location.host) { open(link.href); @@ -104,13 +114,13 @@ function onlink(e) { window.history.pushState({}, "", link.href); document.title = 'CheezeNotes - ' + link.getAttribute('data-href'); ta.value = data; - load(document.getElementById('ta'), document.getElementById('cheezenotes')); + load(document.getElementById('ta'), cheezenotes); - let editModeButton = document.getElementById('editModeButton'); + /*let editModeButton = document.getElementById('editModeButton'); if (editModeButton.classList.contains('buttonoff')) { let cheezenotes = document.getElementById('cheezenotes'); cheezenotes.contentEditable = false; - } + }*/ content.scrollTop = 0; content.scrollLeft = 0; }); @@ -125,7 +135,7 @@ function onlink(e) { function onlinkout(e) { let cheezenotes = document.getElementById('cheezenotes'); if (cheezenotes.contentEditable == 'false') { - cheezenotes.contentEditable = true; + setEditable(); } }