diff options
Diffstat (limited to 'public/assets/js/lib/views/details/index.js')
| -rw-r--r-- | public/assets/js/lib/views/details/index.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/public/assets/js/lib/views/details/index.js b/public/assets/js/lib/views/details/index.js index 8dc92f6..5550173 100644 --- a/public/assets/js/lib/views/details/index.js +++ b/public/assets/js/lib/views/details/index.js @@ -12,6 +12,8 @@ var DetailsView = View.extend({ this.gallery = new GalleryView ({ parent: this }) this.form = new CommentForm ({ parent: this }) this.threadbox = new ThreadBox ({ parent: this }) + this.settings = new ThreadSettingsForm ({ parent: this }) + $(".settings_link").click(this.openSettings.bind(this)) }, load: function(id){ @@ -20,11 +22,15 @@ var DetailsView = View.extend({ }, populate: function(data){ + this.data = data + console.log(data) + set_background_color(data.thread.color || data.keyword.color) $("body").removeClass('loading') var thread = data.thread $("h1").html(sanitize(thread.title)) $("title").html(sanitize(thread.title)) - $(".subtitle").show().html("<a href='/'>< Home</a> | " + metadata(thread)) + $(".metadata").html(metadata(thread)) + $(".settings_link").attr("href", "/details/" + thread.id + "/settings") this.form.load(data.thread) this.comments.load(data.comments) this.files.load(data.files) @@ -32,14 +38,18 @@ var DetailsView = View.extend({ if (data.thread.keyword) { $.get(this.keywordAction + data.thread.keyword, this.populateKeyword.bind(this)) } + if (this.options.settings) { + this.openSettings() + } }, populateKeyword: function(data){ this.threadbox.load(data) }, - success: function(){ - window.location.href = "/index" + openSettings: function(e){ + e && e.preventDefault() + this.settings.show() }, }) |
