Skip to content

Commit

Permalink
Grid-view-follow-up (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
divyabaid16 authored and SidharthBansal committed Sep 4, 2019
1 parent c902028 commit d5d0943
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
10 changes: 8 additions & 2 deletions app/assets/stylesheets/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
margin-left: 25px;
margin-bottom: 10px;
display: inline-block;
padding-right: 30px;
color: orange;
margin-right: 30px;
color: #5cb85c;
cursor: pointer;
font-size: 18px;
}
.grid-list a{
border: 1px solid #e1e4e8;
padding: 5px;
}
.image-order{
display: inline-block;
Expand Down
17 changes: 12 additions & 5 deletions app/views/images/_index.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div>
<h4 class="sidebar-heading">Images</h4>
<div class="grid-list">
<button class="list-view" onClick="list()"><i class="fa fa-bars"></i></button>
<button class="grid-view" onClick="grid()"><i class="fa fa-th"></i></button>
<a class="list-view" onClick="list()"><i class="fa fa-bars"></i></a>
<a class="grid-view" onClick="grid()"><i class="fa fa-th"></i></a>
</div>
<div class="image-order">
<p style="display: inline;">Sort by: </p>
Expand Down Expand Up @@ -144,10 +144,17 @@
function grid(){
$('td').hide();
$('.warpable').show();
$('tr').css('display','inline-block');
$('.warpable').css('padding','0.75rem 0.5rem')
$('tr').css({
'display':'inline-block',
'height' : '100px',
'overflow' : 'hidden'
});
}
function list(){
$('td').show()
$('td').show();
$('tr').css({
'display':'',
'height' : '',
});
}
</script>

0 comments on commit d5d0943

Please sign in to comment.