about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-08-21 21:37:47 +0300
committerBonfaceKilz2024-08-29 18:58:56 +0300
commitd8780211bea450da1f9f25c5558ca68314026dc3 (patch)
tree49cac90550927e5d9efdde5d68913fd6023b7a1d
parenta0f9be94930241544a00bf2f214daf9171d6a82f (diff)
downloadgenenetwork2-d8780211bea450da1f9f25c5558ca68314026dc3.tar.gz
Add diff btn for navbar.
-rw-r--r--gn2/wqflask/templates/gn_editor.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/gn2/wqflask/templates/gn_editor.html b/gn2/wqflask/templates/gn_editor.html
index 2c0d8a36..9e4d4a98 100644
--- a/gn2/wqflask/templates/gn_editor.html
+++ b/gn2/wqflask/templates/gn_editor.html
@@ -1,6 +1,11 @@
 {% extends "base.html" %}
 {% block title %}Genenetwork Files Editor{% endblock %}
 {% block css %}
+    <style>
+  #diffBtn {
+      cursor:pointer
+  }
+    </style>
     <link rel="stylesheet"
           type="text/css"
           href="{{ url_for('css', filename='diff2html/diff2html.min.css') }}" />
@@ -27,6 +32,9 @@
                                    hx-swap="innerHTML">Commit</a>
                             </li>
                             <li>
+                                <a hx-trigger="click" id="diffBtn"  hx-swap="innerHTML">Diff</a>
+                            </li>
+                            <li>
                                 <a href="#"
                                    hx-get="/editor/settings"
                                    hx-target="#output"
@@ -179,6 +187,17 @@
           }
 
       })
+
+      htmx.on("#diffBtn","click",function(event){
+          //dispatch your event here
+	  console.log("Clicked diff btn here")
+	  htmx.find("#output").dispatchEvent(
+          new CustomEvent("diffEvent", {
+              bubbles: true,
+              detail: {},
+          }),
+      );
+      })
       function updatePreview(){
           const {markedHighlight} = globalThis.markedHighlight;