inserted line breaks and wrote a test for app.views.Content.smallPhotos
This commit is contained in:
parent
7a4dbc8b67
commit
9636f372a4
2 changed files with 21 additions and 3 deletions
|
|
@ -60,13 +60,15 @@ jQuery.fn.center = (function() {
|
|||
self.scrollleft.click(function(evt){
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
self.navigation.animate({scrollLeft: (self.navigation.scrollLeft() - (self.window.width() - 150))}, 200, 'swing');
|
||||
self.navigation.animate({scrollLeft: (self.navigation.scrollLeft()
|
||||
- (self.window.width() - 150))}, 200, 'swing');
|
||||
});
|
||||
|
||||
self.scrollright.click(function(evt){
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
self.navigation.animate({scrollLeft: (self.navigation.scrollLeft() + (self.window.width() - 150))}, 200, 'swing');
|
||||
self.navigation.animate({scrollLeft: (self.navigation.scrollLeft()
|
||||
+ (self.window.width() - 150))}, 200, 'swing');
|
||||
});
|
||||
|
||||
self.body.keydown(function(evt) {
|
||||
|
|
@ -148,7 +150,8 @@ jQuery.fn.center = (function() {
|
|||
};
|
||||
|
||||
this.scrollToThumbnail = function(imageThumb) {
|
||||
self.navigation.animate({scrollLeft: (self.navigation.scrollLeft() + imageThumb.offset().left +35 - (self.window.width() / 2))}, 200, 'swing');
|
||||
self.navigation.animate({scrollLeft: (self.navigation.scrollLeft()
|
||||
+ imageThumb.offset().left +35 - (self.window.width() / 2))}, 200, 'swing');
|
||||
}
|
||||
|
||||
this.selectImage = function(imageThumb) {
|
||||
|
|
|
|||
15
spec/javascripts/app/views/content_view_spec.js
Normal file
15
spec/javascripts/app/views/content_view_spec.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
describe("app.views.Content", function(){
|
||||
beforeEach(function(){
|
||||
this.post = new app.models.StatusMessage();
|
||||
this.view = new app.views.Content({model : this.post})
|
||||
});
|
||||
|
||||
describe("rendering", function(){
|
||||
|
||||
it("should return all but the first photo from the post", function() {
|
||||
this.post.set({photos : [1,2]}) // set 2 Photos
|
||||
expect(this.view.smallPhotos().length).toEqual(1)
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue