#267: jump to top/bottom buttons for long pastes and the editor
Fixed-position Top/Bottom pills appear only when content exceeds 2x viewport height (window scroll on paste view, textarea scroll on /new). New static/jump.js drives them; markup added to paste.html and new.html.
This commit is contained in:
@@ -33,6 +33,10 @@
|
||||
<div class="spacer spacer-flex"></div>
|
||||
<button class="btn" id="create">Create</button>
|
||||
</div>
|
||||
<div class="jumpnav hidden" id="jumpnav" data-jump-scroll="#content">
|
||||
<button type="button" class="btn jump-btn" data-jump="top">Top</button>
|
||||
<button type="button" class="btn jump-btn" data-jump="bottom">Bottom</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pane-r">
|
||||
@@ -90,4 +94,5 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/new.js" defer></script>
|
||||
<script src="/static/jump.js" defer></script>
|
||||
{{template "foot" .}}
|
||||
|
||||
@@ -55,8 +55,13 @@
|
||||
<div class="code" id="code"><div class="gutter" id="gutter">{{.Gutter}}</div><div class="codebody" id="codebody">{{.ContentHTML}}</div></div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="jumpnav hidden" id="jumpnav">
|
||||
<button type="button" class="btn jump-btn" data-jump="top">Top</button>
|
||||
<button type="button" class="btn jump-btn" data-jump="bottom">Bottom</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="raw-content" value="{{.ContentAttr}}">
|
||||
<script src="/static/paste.js" defer data-paste-id="{{.ID}}"></script>
|
||||
<script src="/static/paste-lines.js" defer></script>
|
||||
<script src="/static/jump.js" defer></script>
|
||||
{{template "foot" .}}
|
||||
|
||||
Reference in New Issue
Block a user