diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-12 02:09:15 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-12 02:09:15 +0100 |
| commit | 41d0bd185c19c8a51ed9b85700f52181b6cc5012 (patch) | |
| tree | 76d4524fff4221da47e57ea0bcdb0917d592b5d1 /public/assets/js/lib/views/details/index.js | |
| parent | ce73133c4e982db99f218bf930d82eb991ce81e3 (diff) | |
color stuff, building settings form
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() }, }) |
