change lot of stuff

This commit is contained in:
Julius Haertl
2016-07-30 22:21:12 +02:00
parent d61dcdb614
commit 9abd92c4e4
29 changed files with 864 additions and 204 deletions

28
js/directive/search.js Normal file
View File

@@ -0,0 +1,28 @@
app.directive('search', function ($document, $location) {
'use strict';
return {
restrict: 'E',
scope: {
'onSearch': '='
},
link: function (scope) {
var box = $('#searchbox');
box.val($location.search().search);
var doSearch = function() {
var value = box.val();
scope.$apply(function () {
scope.onSearch(value);
});
}
box.on('search keyup', function (event) {
if (event.type === 'search' || event.keyCode === 13 ) {
doSearch();
}
});
}
};
});