Skip to content

Commit

Permalink
only show snackbar on public
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Feb 23, 2019
1 parent edc8044 commit 071c9e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions static/js/rwtxt.js
Expand Up @@ -202,8 +202,10 @@ if (getParameterByName("edit") != null) {

function showMessage() {
var x = document.getElementById("snackbar");
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
if (x != null) {
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}
}


Expand Down
2 changes: 2 additions & 0 deletions templates/viewedit.html
Expand Up @@ -31,7 +31,9 @@
<textarea class="fonty" id="editable" style="-webkit-user-select:text;{{if not .EditOnly}}display:none;{{end}}" rows={{ .Rows }} placeholder="Click here and start writing" autofocus>{{.File.Data}}</textarea>
</form>
</main>
{{ if (eq .Domain "public") }}
<div id="snackbar">Write markdown, reload page when you are done!</div>
{{ end }}

<script>
window.rwtxt = {
Expand Down

0 comments on commit 071c9e1

Please sign in to comment.