now you can click on an entire post to favorite / unfav it. yay. [ci skip]
This commit is contained in:
parent
4be6f196cd
commit
dbe3b48aee
3 changed files with 29 additions and 2 deletions
|
|
@ -69,6 +69,7 @@ app.views.SmallFrame = app.views.Base.extend({
|
|||
},
|
||||
|
||||
goToPost : function() {
|
||||
if(app.page.editMode) { this.favoritePost(); return false; }
|
||||
app.router.navigate(this.model.url(), true)
|
||||
}
|
||||
});
|
||||
|
|
@ -41,13 +41,18 @@
|
|||
.edit-mode {
|
||||
#edit-controls {
|
||||
@include opacity(1);
|
||||
//display : block;
|
||||
}
|
||||
|
||||
.canvas-frame .fav {
|
||||
@include opacity(1)
|
||||
}
|
||||
|
||||
.canvas-frame {
|
||||
.info {
|
||||
display : none
|
||||
}
|
||||
}
|
||||
|
||||
#edit-mode-toggle.control {
|
||||
@include opacity(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,25 @@ describe("app.views.SmallFrame", function(){
|
|||
describe("photos", function() {
|
||||
// ratio pending...
|
||||
})
|
||||
});
|
||||
|
||||
describe("redirecting to a post", function(){
|
||||
beforeEach(function(){
|
||||
app.router = new app.Router()
|
||||
spyOn(app.router, "navigate")
|
||||
})
|
||||
|
||||
it("redirects", function() {
|
||||
this.view.goToPost()
|
||||
expect(app.router.navigate).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it("doesn't redirect if the page is in edit mode, and instead favorites the post", function() {
|
||||
app.page = {editMode : true}
|
||||
|
||||
spyOn(this.view, "favoritePost")
|
||||
this.view.goToPost()
|
||||
expect(app.router.navigate).not.toHaveBeenCalled()
|
||||
expect(this.view.favoritePost).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue