diff options
-rw-r--r-- | gn2/wqflask/templates/gn_editor.html | 19 |
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; |