Working on task kanban

This commit is contained in:
Hillel Coren 2017-12-19 22:57:05 +02:00
parent 1931cf2c6a
commit a355ab0d67
2 changed files with 43 additions and 3 deletions

View File

@ -57,6 +57,7 @@
window.loadedSearchData = true;
trackEvent('/activity', '/search');
var request = $.get('{{ URL::route('get_search_data') }}', function(data) {
console.log(data);
$('#search').typeahead({
hint: true,
highlight: true,

View File

@ -15,6 +15,10 @@
width: 100%;
}
.tt-input {
background-color: #FFFFFF !important;
}
.kanban-column {
background-color: #E9E9E9;
padding: 10px;
@ -113,7 +117,7 @@
@section('top-right')
<div class="form-group">
<input type="text" placeholder="{{ trans('texts.filter') }}" data-bind="value: filter, valueUpdate: 'afterkeydown'"
<input type="text" placeholder="{{ trans('texts.filter') }}" id="filter"
class="form-control" style="background-color: #FFFFFF !important"/>
</div>
@stop
@ -131,6 +135,9 @@
var clientMap = {};
var statusMap = {};
var clientList = [];
var projectList = [];
ko.bindingHandlers.enterkey = {
init: function (element, valueAccessor, allBindings, viewModel) {
var callback = valueAccessor();
@ -185,11 +192,19 @@
for (var i=0; i<projects.length; i++) {
var project = projects[i];
projectMap[project.public_id] = new ProjectModel(project);
projectList.push({
value: project.name,
tokens: project.name,
})
}
for (var i=0; i<clients.length; i++) {
var client = clients[i];
clientMap[client.public_id] = new ClientModel(client);
clientList.push({
value: client.name,
tokens: client.name,
})
}
for (var i=0; i<tasks.length; i++) {
@ -521,8 +536,32 @@
}
$(function() {
toastr.options.timeOut = 3000;
toastr.options.positionClass = 'toast-bottom-right';
$('#filter').typeahead({
hint: true,
highlight: true,
},{
name: 'data',
limit: 4,
display: 'value',
source: searchData(clientList, 'tokens'),
templates: {
header: '&nbsp;<span style="font-weight:600;font-size:15px">{{ trans('texts.clients') }}</span>'
}
},{
name: 'data',
limit: 4,
display: 'value',
source: searchData(projectList, 'tokens'),
templates: {
header: '&nbsp;<span style="font-weight:600;font-size:15px">{{ trans('texts.projects') }}</span>'
}
}).on('typeahead:selected', function(element, datum, name) {
model.filter(datum.value);
});
$('#filter').on('keyup', function() {
model.filter($('#filter').val());
});
window.model = new ViewModel();
ko.applyBindings(model);