summaryrefslogtreecommitdiff
path: root/public/assets/js/lib
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-11 01:45:57 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-11 01:45:57 +0100
commit6702125f12820c504ae18114f99fee3e13b2616f (patch)
treef775b3d409951e1078547d380fc87a2da69cddb5 /public/assets/js/lib
parent7b6a999eb2ae4ade37acd045cf8f806b4021d4c1 (diff)
moreeeeee styling
Diffstat (limited to 'public/assets/js/lib')
-rw-r--r--public/assets/js/lib/views/details/comments.js3
-rw-r--r--public/assets/js/lib/views/index/index.js1
-rw-r--r--public/assets/js/lib/views/search/results.js4
3 files changed, 5 insertions, 3 deletions
diff --git a/public/assets/js/lib/views/details/comments.js b/public/assets/js/lib/views/details/comments.js
index 4bd2eb7..c031efc 100644
--- a/public/assets/js/lib/views/details/comments.js
+++ b/public/assets/js/lib/views/details/comments.js
@@ -10,6 +10,7 @@ var CommentsView = FormView.extend({
initialize: function(){
this.__super__.initialize.call(this)
this.template = this.$(".template").html()
+ this.$formRow = this.$("#comment_form")
},
load: function(comments){
@@ -33,7 +34,7 @@ var CommentsView = FormView.extend({
appendComment: function(comment){
var $el = $( this.parse(comment) )
- this.$el.append($el)
+ $el.insertBefore(this.$formRow)
},
success: function(){
diff --git a/public/assets/js/lib/views/index/index.js b/public/assets/js/lib/views/index/index.js
index c4d1330..840f150 100644
--- a/public/assets/js/lib/views/index/index.js
+++ b/public/assets/js/lib/views/index/index.js
@@ -22,6 +22,7 @@ var IndexView = View.extend({
this.hootbox.load(data.hootbox)
this.threadbox.load(data)
this.lastlog.load(data.lastlog)
+ $("#search_form input").focus()
},
success: function(){
diff --git a/public/assets/js/lib/views/search/results.js b/public/assets/js/lib/views/search/results.js
index 2c992e7..516f10d 100644
--- a/public/assets/js/lib/views/search/results.js
+++ b/public/assets/js/lib/views/search/results.js
@@ -33,7 +33,7 @@ var SearchResults = View.extend({
start: res.meta.start + res.meta.limit,
limit: res.meta.limit,
}
- this.$(".next_page").toggle(res.meta.start + res.meta.limit > res.meta.count)
+ this.$(".next_page").toggle(res.meta.next < res.meta.total)
this.$(".next_page").attr("href", querystring(next_page))
res.results.forEach((result) => {
if (! result.thread) {
@@ -70,7 +70,7 @@ function bold_terms (s, terms) {
return s
}
function querystring(opt){
- var s = Object.keys(opt).map((key) => {
+ return '?' + Object.keys(opt).map((key) => {
return encodeURIComponent(key) + "=" + encodeURIComponent(opt[key])
}).join("&")
}