summaryrefslogtreecommitdiff
path: root/public/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js')
-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("&")
}