Commit c95cb96b authored by Aron Carroll's avatar Aron Carroll

Remove the outline from the search box

parent 7faaf2dc
...@@ -402,10 +402,12 @@ fuzzytime = ['$filter', '$window', ($filter, $window) -> ...@@ -402,10 +402,12 @@ fuzzytime = ['$filter', '$window', ($filter, $window) ->
simpleSearch = ['$parse', ($parse) -> simpleSearch = ['$parse', ($parse) ->
uuid = 0
link: (scope, elem, attr, ctrl) -> link: (scope, elem, attr, ctrl) ->
_search = $parse(attr.onsearch) _search = $parse(attr.onsearch)
_clear = $parse(attr.onclear) _clear = $parse(attr.onclear)
scope.viewId = uuid++
scope.dosearch = -> scope.dosearch = ->
_search(scope, {"this": scope.searchtext}) _search(scope, {"this": scope.searchtext})
...@@ -422,8 +424,8 @@ simpleSearch = ['$parse', ($parse) -> ...@@ -422,8 +424,8 @@ simpleSearch = ['$parse', ($parse) ->
restrict: 'C' restrict: 'C'
template: ''' template: '''
<form class="simple-search-form" ng-class="!searchtext && 'simple-search-inactive'" name="searchBox" ng-submit="dosearch()"> <form class="simple-search-form" ng-class="!searchtext && 'simple-search-inactive'" name="searchBox" ng-submit="dosearch()">
<input class="simple-search-input" type="text" ng-model="searchtext" name="searchText" placeholder="Search…" /> <input id="simple-search-{{viewId}}" class="simple-search-input" type="text" ng-model="searchtext" name="searchText" placeholder="Search…" />
<i class="simple-search-icon icon-search"></i> <label for="simple-search-{{viewId}}" class="simple-search-icon icon-search"></label>
<button class="simple-search-clear" type="reset" ng-hide="!searchtext" ng-click="reset($event)"> <button class="simple-search-clear" type="reset" ng-hide="!searchtext" ng-click="reset($event)">
<i class="icon-x"></i> <i class="icon-x"></i>
</button> </button>
......
...@@ -5,17 +5,24 @@ ...@@ -5,17 +5,24 @@
} }
.simple-search-form { .simple-search-form {
@include clearfix;
position: relative; position: relative;
padding: 0 (20 / 13 * 1em);
color: $gray; color: $gray;
} }
.simple-search-form * {
box-sizing: border-box;
}
.simple-search-icon { .simple-search-icon {
position: absolute; float: left;
display: inline;
font-size: 1.1em; font-size: 1.1em;
top: 50%; line-height: 2;
left: .6em; margin-left: -100%;
margin-top: -.5em; position: relative;
pointer-events: none; right: 20 / 14 * 1em;
:not(:focus) ~ & { :not(:focus) ~ & {
color: $gray-lighter; color: $gray-lighter;
...@@ -23,13 +30,12 @@ ...@@ -23,13 +30,12 @@
} }
.simple-search-input { .simple-search-input {
float: left;
outline: none; outline: none;
color: $text-color; color: $text-color;
line-height: 24px;
width: 100%; width: 100%;
border-radius: 2em; border: none !important; // Override base input styles.
border: 1px solid $gray-lighter !important; // Override base input styles. padding: (5 / 13 * 1em) 0;
padding: 0 2em;
.simple-search-inactive &:not(:focus) { .simple-search-inactive &:not(:focus) {
border-color: #f3f3f3 !important; border-color: #f3f3f3 !important;
...@@ -43,29 +49,23 @@ ...@@ -43,29 +49,23 @@
left: 50%; left: 50%;
margin-top: -.5em; margin-top: -.5em;
margin-left: -.5em; margin-left: -.5em;
font-size: .7em; font-size: 0.85em;
} }
position: absolute; float: left;
position: relative;
top: 6 / 13 * 1em;
margin-right: -1.33em;
padding: 0;
outline: none; outline: none;
right: .35em;
top: 50%;
border: none; border: none;
border-radius: 50%; background: none;
background: $gray-light; color: $gray;
color: #fff;
width: 1.33em; width: 1.33em;
height: 1.33em; height: 1.33em;
padding: 0;
margin-top: -.65em;
@include box-shadow(none); @include box-shadow(none);
&:focus, &:hover, &:active:not([disabled]) { &:focus, &:hover, &:active:not([disabled]) {
@include transition(background-color 200ms ease-in); color: $text-color;
background-color: $gray-light;
color: #fff;
border: none;
background-image: none;
box-shadow: none;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment