~sircmpwn/godocs.io

gddo: gddo-server: Remove broken Close button v1 APPLIED

Adnan Maolood: 1
 gddo-server: Remove broken Close button

 2 files changed, 9 insertions(+), 13 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/godocs.io/patches/22535/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gddo] gddo-server: Remove broken Close button Export this patch

---
The Close button is non-functional, and redundant, so remove it.

 gddo-server/assets/site.js               |  1 -
 gddo-server/assets/templates/layout.html | 21 +++++++++------------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/gddo-server/assets/site.js b/gddo-server/assets/site.js
index e237760..fc54f09 100644
--- a/gddo-server/assets/site.js
+++ b/gddo-server/assets/site.js
@@ -1,7 +1,6 @@
// modal
function Modal(el) {
	this.el = el
	el.querySelector(".close").onclick = () => this.hide()
	el.onclick = () => this.hide()
	el.onkeydown = (e) => {
		if (e.key == "Escape") {
diff --git a/gddo-server/assets/templates/layout.html b/gddo-server/assets/templates/layout.html
index dfdff9f..dba3b7a 100644
--- a/gddo-server/assets/templates/layout.html
+++ b/gddo-server/assets/templates/layout.html
@@ -43,14 +43,14 @@
</div>

<div id="x-shortcuts" tabindex="-1" class="modal">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" aria-hidden="true">&times;</button>
          <h4 class="modal-title">Keyboard shortcuts</h4>
        </div>
        <div class="modal-body">
          <table>{{$mutePkg := not (equal "pkg.html" templateName)}}
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Keyboard shortcuts</h4>
      </div>
      <div class="modal-body">
        <table>{{$mutePkg := not (equal "pkg.html" templateName)}}
          <tr><td align="right"><b>?</b></td><td> : This menu</td></tr>
          <tr><td align="right"><b>/</b></td><td> : Search site</td></tr>
          <tr{{if $mutePkg}} class="text-muted"{{end}}><td align="right"><b>f</b></td><td> : Jump to identifier</td></tr>
@@ -59,10 +59,7 @@
          <tr><td align="right"><b>G</b></td><td> : Go to end of page</td></tr>
          <tr{{if $mutePkg}} class="text-muted"{{end}}><td align="right"><b>g</b> then <b>i</b></td><td> : Go to index</td></tr>
          <tr{{if $mutePkg}} class="text-muted"{{end}}><td align="right"><b>g</b> then <b>e</b></td><td> : Go to examples</td></tr>
          </table>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn">Close</button>
        </table>
      </div>
    </div>
  </div>
-- 
2.31.1
Thanks!

To git@git.sr.ht:~sircmpwn/gddo
   16608f7..c5d1165  master -> master