diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-27 12:48:06 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-27 12:48:06 +0100 |
| commit | 994f212275f71cc48c4938f0e0cc1fa0dc4eee38 (patch) | |
| tree | b30fd4a635b1a8a04ee4975a67e77aecde4eb22c /public/assets/js/nav.js | |
| parent | 1fac54a69a4fd21b28953f2073904cbd3aee8577 (diff) | |
| parent | 4d66be70dde0b6918291d70b08b50bc952d7052a (diff) | |
shader-saving endpoint
Diffstat (limited to 'public/assets/js/nav.js')
| -rw-r--r-- | public/assets/js/nav.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/public/assets/js/nav.js b/public/assets/js/nav.js index c768b51..a53f6fb 100644 --- a/public/assets/js/nav.js +++ b/public/assets/js/nav.js @@ -5,9 +5,6 @@ var NavView = View.extend({ "click .prev": "prev", "click .next": "next", "click .link": "link", -// "touchstart .prev": "prev", -// "touchstart .next": "next", -// "touchstart .link": "link", "click .refresh": "refresh", "click .random": "random", }, @@ -29,11 +26,11 @@ var NavView = View.extend({ if (window.location.pathname.indexOf("/p/") !== -1) { var id = window.location.pathname.split("/")[2] - this.fetch(id) - } - else { - this.latest() + if (parseInt(id) || id === 'random' || id === 'latest') { + return this.fetch(id) + } } + return this.latest() $(".prev").on("touchstart", function(){ console.log("<<<<<PREV") @@ -87,7 +84,9 @@ var NavView = View.extend({ fetch: function(id){ this.fetching = true this.onLatest = false +console.log('fetch', id) $.get("/p/get/" + id, function(data){ +console.log(data) this.fetching = false this.display(data) history.pushState(data, document.title, "/p/" + data.id) |
