diff --git a/public/templates/directives/search.html b/public/templates/directives/search.html index f2ebdcae..ec044091 100644 --- a/public/templates/directives/search.html +++ b/public/templates/directives/search.html @@ -7,19 +7,24 @@ pfm-popup="search-results" /> -
-

Matching tracks

- +
+
+

Matching tracks

+ -

Matching albums

- +
-

Matching playlists

- +
+

Matching users

+
    +
  1. +
-

Matching users

-
    -
  1. -
-
+

Matching albums

+ + +

Matching playlists

+ +
+ diff --git a/resources/assets/scripts/app/directives/popup.coffee b/resources/assets/scripts/app/directives/popup.coffee index d1f4311e..d40cc307 100644 --- a/resources/assets/scripts/app/directives/popup.coffee +++ b/resources/assets/scripts/app/directives/popup.coffee @@ -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 diff --git a/resources/assets/scripts/app/directives/search.coffee b/resources/assets/scripts/app/directives/search.coffee index 9425ddf9..ed0280fb 100644 --- a/resources/assets/scripts/app/directives/search.coffee +++ b/resources/assets/scripts/app/directives/search.coffee @@ -59,5 +59,5 @@ angular.module('ponyfm').directive 'pfmSearch', () -> for user in results.users $scope.users.push(user) - , 500) + , 200) ] diff --git a/resources/assets/styles/search.less b/resources/assets/styles/search.less index 612873ac..c980ab8f 100644 --- a/resources/assets/styles/search.less +++ b/resources/assets/styles/search.less @@ -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; }