Merge branch 'master' of github.com:mozilla/seasponge

This commit is contained in:
Glavin Wiechert 2014-12-18 00:01:48 -04:00
Родитель 8648e5083f 185b2e13b2
Коммит d70b824c22
3 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -11,10 +11,19 @@ angular.module('seaspongeApp')
.controller 'DrawController', ['$scope', 'Stencils', 'model', ($scope, Stencils, model) ->
console.log('model', model)
$scope.model = model
$scope.stencils = Stencils
$scope.stencilQuery = ''
$scope.filterFn = (query, values) ->
results = []
angular.forEach values, ((value, key) ->
@push value if value.title.toLowerCase().indexOf(query.toLowerCase()) isnt -1 or value.category.toLowerCase().indexOf(query.toLowerCase()) isnt -1
return
), results
if results.length > 0
results
else
values
$scope.menu = {
infoOpen: false

Просмотреть файл

@ -75,6 +75,11 @@
text-align: center;
}
.stencil-search {
width: 95% !important;
margin-left: 10px !important;
}
// Shapes
.circle {
width: 100px !important;

Просмотреть файл

@ -89,8 +89,8 @@
</accordion-heading>
<div class="all-stencils row">
<div ng-repeat="stencil in stencils">
<input type="text" class="form-control stencil-search" ng-model="stencilQuery" placeholder="Search Stencils">
<div data-ng-repeat="stencil in filterFn(stencilQuery, stencils)">
<div class="stencil col-xs-6 col-md-4 col-lg-4"
draggable="true" data-drag="true" jqyoui-draggable ng-model="stencil"
data-jqyoui-options="{helper: 'clone', animate: true, placeholder: 'keep'}">