mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
#1: Improved the layout of the search results.
This commit is contained in:
parent
93b447f05c
commit
864112b1f2
4 changed files with 45 additions and 21 deletions
|
@ -7,19 +7,24 @@
|
|||
pfm-popup="search-results"
|
||||
/>
|
||||
|
||||
<div class="search-results pfm-popup" id="search-results">
|
||||
<h3 class="-section-header">Matching tracks</h3>
|
||||
<pfm-tracks-list tracks="tracks"></pfm-tracks-list>
|
||||
<section class="search-results pfm-popup" id="search-results">
|
||||
<div class="-column1">
|
||||
<h3 class="-section-header">Matching tracks</h3>
|
||||
<pfm-tracks-list tracks="tracks"></pfm-tracks-list>
|
||||
|
||||
<h3 class="-section-header">Matching albums</h3>
|
||||
<pfm-albums-list albums="albums"></pfm-albums-list>
|
||||
</div>
|
||||
|
||||
<h3 class="-section-header">Matching playlists</h3>
|
||||
<pfm-playlists-list playlists="playlists"></pfm-playlists-list>
|
||||
<div class="-column2">
|
||||
<h3 class="-section-header">Matching users</h3>
|
||||
<ol>
|
||||
<li bindonce ng-repeat="user in users track by user.id" bo-text="user.display_name"></li>
|
||||
</ol>
|
||||
|
||||
<h3 class="-section-header">Matching users</h3>
|
||||
<ol>
|
||||
<li bindonce ng-repeat="user in users track by user.id" bo-text="user.display_name"></li>
|
||||
</ol>
|
||||
</div>
|
||||
<h3 class="-section-header">Matching albums</h3>
|
||||
<pfm-albums-list albums="albums"></pfm-albums-list>
|
||||
|
||||
<h3 class="-section-header">Matching playlists</h3>
|
||||
<pfm-playlists-list playlists="playlists"></pfm-playlists-list>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
@ -55,10 +55,13 @@ angular.module('ponyfm').directive 'pfmPopup', () ->
|
|||
calculatePosition = ->
|
||||
$popup.parents().each () ->
|
||||
$this = $ this
|
||||
$positionParent = $this if $positionParent == null && ($this.css('position') == 'relative' || $this.is 'body')
|
||||
|
||||
if $positionParent == null && ($this.css('position') == 'relative' || $this.is 'body')
|
||||
$positionParent = $this
|
||||
return false
|
||||
|
||||
position = $element.offset()
|
||||
parentPosition = $positionParent.offset()
|
||||
parentPosition = $positionParent.offset() + $positionParent.height()
|
||||
|
||||
windowWidth = $(window).width() - 15
|
||||
left = position.left
|
||||
|
@ -89,7 +92,7 @@ angular.module('ponyfm').directive 'pfmPopup', () ->
|
|||
$popup.css
|
||||
left: position.left
|
||||
top: position.top
|
||||
height: position.height
|
||||
maxHeight: position.height
|
||||
|
||||
$(document.body).bind 'click', documentClickHandler
|
||||
$(window).bind 'resize', windowResizeHandler
|
||||
|
|
|
@ -59,5 +59,5 @@ angular.module('ponyfm').directive 'pfmSearch', () ->
|
|||
|
||||
for user in results.users
|
||||
$scope.users.push(user)
|
||||
, 500)
|
||||
, 200)
|
||||
]
|
||||
|
|
26
resources/assets/styles/search.less
vendored
26
resources/assets/styles/search.less
vendored
|
@ -20,25 +20,41 @@
|
|||
@import 'mixins';
|
||||
@import 'variables';
|
||||
|
||||
.search {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
|
||||
input.search-input {
|
||||
font-size: 13px;
|
||||
padding: 15px 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.search-results {
|
||||
position: absolute;
|
||||
width: 500px;
|
||||
width: 600px;
|
||||
padding: 10px;
|
||||
|
||||
background: #fff;
|
||||
|
||||
.-column1, .-column2 {
|
||||
width: 48%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.-column1 {
|
||||
padding-right: 2%;
|
||||
}
|
||||
|
||||
.-column2 {
|
||||
padding-left: 2%;
|
||||
}
|
||||
|
||||
ol li {
|
||||
list-style: disc;
|
||||
}
|
||||
|
||||
li a {
|
||||
padding: 0;
|
||||
padding-right: 0;
|
||||
overflow: hidden;
|
||||
color: @pfm-light-grey;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue