Mercurial > zeropaste
comparison app/javascript/src/main.coffee @ 478:46ed68bf9918
Add more length check
author | nanaya <me@nanaya.pro> |
---|---|
date | Sat, 10 Oct 2020 18:14:57 +0900 |
parents | 68231013b01b |
children | b493db1f40b0 |
comparison
equal
deleted
inserted
replaced
477:7a20b4906267 | 478:46ed68bf9918 |
---|---|
72 $(".js-paste-preview-md-box").html markdownfy(pasteText()) | 72 $(".js-paste-preview-md-box").html markdownfy(pasteText()) |
73 $(".js-paste-preview-md-modal").modal "show" | 73 $(".js-paste-preview-md-modal").modal "show" |
74 | 74 |
75 | 75 |
76 switchToCurrentHash = -> | 76 switchToCurrentHash = -> |
77 return unless $(".js-showing-paste").length | 77 return if $(".js-showing-paste").length == 0 |
78 | 78 |
79 format = window.location.hash.slice(1) | 79 format = window.location.hash.slice(1) |
80 | |
81 return if format.length == 0 | |
80 $(".js-show-tab[data-mode=#{format}]").click() | 82 $(".js-show-tab[data-mode=#{format}]").click() |
81 | 83 |
82 | 84 |
83 $ loadLanguageItems | 85 $ loadLanguageItems |
84 $ switchToCurrentHash | 86 $ switchToCurrentHash |