Skip to content

Commit

Permalink
Make media collapsible
Browse files Browse the repository at this point in the history
  • Loading branch information
David Petersen authored and David Petersen committed Feb 20, 2012
1 parent 009a5b9 commit 233fc8c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/css/subway.css
Expand Up @@ -114,6 +114,9 @@ html { overflow: hidden; }
color: #EEEEEE;
font-weight: bold;
border-top: 1px solid #666666;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

#user-box div:first-child{
Expand All @@ -122,9 +125,6 @@ html { overflow: hidden; }

#user-box div:last-child{
border-left: 5px solid #FA6900;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

#user-box div i{
Expand Down
17 changes: 17 additions & 0 deletions assets/js/views/chat.js
Expand Up @@ -28,6 +28,7 @@ var ChatView = Backbone.View.extend({
this.updateTitle();
this.handleInput();
this.handleScroll();
this.handleClick();
$('#chat-input').focus();
return this;
},
Expand Down Expand Up @@ -173,4 +174,20 @@ var ChatView = Backbone.View.extend({
}
});
},

handleClick: function() {
$('.hide_embed').live("click", function() {
var embed_div = $(this).parent().siblings('.embed');
embed_div.addClass('hide');
$(this).siblings('.show_embed').removeClass('hide');
$(this).addClass('hide');
});

$('.show_embed').live("click", function() {
var embed_div = $(this).parent().siblings('.embed');
embed_div.removeClass('hide');
$(this).siblings('.hide_embed').removeClass('hide');
$(this).addClass('hide');
});
},
});
5 changes: 5 additions & 0 deletions views/templates.jade
Expand Up @@ -125,6 +125,11 @@ script(id="link", type="text/html")
a(target="_blank", href="{{link}}") {{link}}

script(id="image_embed", type="text/html")
div
a.hide_embed
i(class="icon-chevron-up")
a.show_embed.hide
i(class="icon-chevron-down")
.embed
img(src="{{link}}")

Expand Down

0 comments on commit 233fc8c

Please sign in to comment.