summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/details/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-07 01:08:00 -0400
committerJules Laplace <jules@okfoc.us>2015-09-07 01:08:00 -0400
commit2bb87671b1c5b59d6c770627b99a17a784f81e1d (patch)
tree18f09b11a4d78a4cbaf4ddab66b6d62e0f8e7426 /public/assets/js/lib/views/details/index.js
parent126c462fe0c93ef55a6dca9ba693d8b43a7a8300 (diff)
stub in details page
Diffstat (limited to 'public/assets/js/lib/views/details/index.js')
-rw-r--r--public/assets/js/lib/views/details/index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/details/index.js b/public/assets/js/lib/views/details/index.js
new file mode 100644
index 0000000..e2adb55
--- /dev/null
+++ b/public/assets/js/lib/views/details/index.js
@@ -0,0 +1,28 @@
+var DetailsView = View.extend({
+
+ events: {
+ },
+
+ action: "/api/thread/",
+
+ initialize: function(opt){
+ this.comments = new CommentsView ({ parent: this })
+ this.files = new FilesView ({ parent: this })
+ },
+
+ load: function(id){
+ id = id.replace(/\D/g, "")
+ $.get(this.action + id, this.populate.bind(this))
+ },
+
+ populate: function(data){
+ $("h1").html(data.thread.title)
+ this.comments.load(data.comments)
+ this.files.load(data.files)
+ },
+
+ success: function(){
+ window.location.href = "/index"
+ },
+
+})