Skip to content

Commit

Permalink
Merge branch 'master' of git.cyberspectrum.de:tenside/ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Becker committed May 14, 2015
2 parents 0d2bd8f + cb7220e commit bd72c22
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
12 changes: 6 additions & 6 deletions assets/javascripts/tenside-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
['$scope', 'tensideSearchData', '$location',
function ($scope, data, $location) {
$scope.keywords = data.getKeywords();
$scope.$watch('keywords', function (value, previous) {
if (value !== previous) {
data.setKeywords(value);
}
});

$scope.search = function() {
$location.path('search');
if($scope.keywords != '') {
data.setKeywords($scope.keywords);
}
};

$scope.searchButtonActive = $scope.keywords == '' ? '' : 'disabled';
}])
.controller('tensideSearchController',
['$scope', '$tensideApi', 'tensideSearchData',
Expand Down
12 changes: 12 additions & 0 deletions assets/stylesheets/partials/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
.form-group {
margin-bottom: 0;
}

.btn-search {
cursor: pointer;
color: #666;
transition: color 0.25s ease;

&.disabled {
cursor: default;
color: #dedede;
transition: color 0.25s ease;
}
}
}

.search-result {
Expand Down
15 changes: 8 additions & 7 deletions assets/templates/_layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ html(lang="en", ng-app="tenside")
span.icon-bar
span.icon-bar
a.navbar-brand(href="#") Tenside
| 
small(translate) SLOGAN
|  
small(translate) SLOGAN
#navbar.collapse.navbar-collapse
ul.nav.navbar-nav.navbar-right
li(role="presentation", ngClass="{active: isActive('/packages')}")
Expand All @@ -48,15 +48,16 @@ html(lang="en", ng-app="tenside")
i.fa.fa-gears Config

.tenside-search
form.form(role="search", ng-controller="tensideSearchHeader")
form.form(role="search", ng-controller="tensideSearchHeader", ng-submit="search()")
.container
.form-group(style="display:inline;")
.input-group
span.input-group-addon
span.fa.fa-search
input.form-control(type="search", placeholder="Search packages", ng-model="keywords", ng-class="{'search__input--focus': focused}", ng-init="focused = false", ng-focus="focused = true", ng-blur="focused = false")
span.input-group-btn
button.btn.btn-default(type="submit", ng-click="search()") Search
div.btn-search.input-group-addon(ng-click="search()", ng-class="{'disabled': keywords == ''}")
i.fa.fa-search
|  
small SEARCH

.body
.container
block content
Expand Down

0 comments on commit bd72c22

Please sign in to comment.