namespacing. set up initial feedback hooks.
This commit is contained in:
parent
e60bd7b3e5
commit
5a1f3675b5
6 changed files with 36 additions and 8 deletions
|
|
@ -12,6 +12,7 @@ javascripts:
|
|||
|
||||
templates:
|
||||
- public/javascripts/app/templates/*.handlebars
|
||||
- public/javascripts/app/templates/**/*.handlebars
|
||||
|
||||
main:
|
||||
- public/javascripts/vendor/underscore.js
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ app.pages.PostViewer = app.views.Base.extend({
|
|||
"#post-content" : "postView",
|
||||
"#post-nav" : "navView",
|
||||
"#post-feedback" : "feedbackView"
|
||||
// "#post-author" : "authorView"
|
||||
},
|
||||
|
||||
postView : function(){
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<div id="user-controls">
|
||||
<a href="#" class="label">
|
||||
<a href="#" class="label profile" title="{{current_user.name}}">
|
||||
<i class="icon-user icon-white"></i>
|
||||
</a>
|
||||
<a href="#" class="label">
|
||||
<a href="#" class="label like" title="Like">
|
||||
<i class="icon-heart icon-white"></i>
|
||||
</a>
|
||||
<a href="#" class="label">
|
||||
<a href="#" class="label follow" title="Follow Post">
|
||||
<i class="icon-plus icon-white"></i>
|
||||
</a>
|
||||
<a href="#" class="label">
|
||||
<a href="#" class="label reshare" title="Reshare">
|
||||
<i class="icon-retweet icon-white"></i>
|
||||
</a>
|
||||
<a href="#" class="label">
|
||||
<a href="#" class="label comment" title="Comment">
|
||||
<i class="icon-comment icon-white"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,34 @@
|
|||
app.views.PostViewerFeedback = app.views.Base.extend({
|
||||
|
||||
templateName: "post-viewer-feedback"
|
||||
templateName: "post-viewer/feedback",
|
||||
|
||||
events : {
|
||||
"click .like" : "toggleLike",
|
||||
"click .follow" : "toggleFollow",
|
||||
"click .reshare" : "reshare",
|
||||
"click .comment" : "comment"
|
||||
},
|
||||
|
||||
tooltipSelector : ".label",
|
||||
|
||||
toggleLike : function(evt) {
|
||||
if(evt) { evt.preventDefault(); }
|
||||
this.model.toggleLike()
|
||||
},
|
||||
|
||||
toggleFollow : function(evt) {
|
||||
if(evt) { evt.preventDefault(); }
|
||||
this.model.toggleFollow()
|
||||
},
|
||||
|
||||
reshare : function(evt) {
|
||||
if(evt) { evt.preventDefault(); }
|
||||
this.model.reshare();
|
||||
},
|
||||
|
||||
comment : function(){
|
||||
alert('comment')
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
app.views.PostViewerNav = app.views.Base.extend({
|
||||
|
||||
templateName: "post-viewer-nav",
|
||||
templateName: "post-viewer/nav",
|
||||
|
||||
postRenderTemplate : function() {
|
||||
var mappings = {"#forward" : "next_post",
|
||||
|
|
|
|||
Loading…
Reference in a new issue