Working on the time tracker

This commit is contained in:
Hillel Coren 2017-10-02 21:22:19 +03:00
parent 2a8651985f
commit 24651bf1e9
2 changed files with 11 additions and 1 deletions

View File

@ -171,7 +171,12 @@
<span class="input-group-addon" style="width:1%;" data-bind="click: onFilterClick, style: { 'background-color': filterState() != 'all' ? '#ffffaa' : '' }" title="{{ trans('texts.filter_sort') }}"><span class="glyphicon glyphicon-filter"></span></span>
<input id="search" type="search" class="form-control search" autocomplete="off" autofocus="autofocus"
data-bind="event: { focus: onFilterFocus, input: onFilterChanged, keypress: onFilterKeyPress }, value: filter, valueUpdate: 'afterkeydown', attr: {placeholder: placeholder, style: filterStyle, disabled: selectedTask().isChanged }">
<span class="input-group-addon" style="width:1%;" data-bind="click: onRefreshClick" title="{{ trans('texts.refresh') }}"><span class="glyphicon glyphicon-repeat"></span></span>
<span class="input-group-addon" style="width:1%;" data-bind="click: onClearClick, visible: filter()" title="{{ trans('texts.refresh') }}">
<span class="glyphicon glyphicon-remove"></span>
</span>
<span class="input-group-addon" style="width:1%;" data-bind="click: onRefreshClick, visible: ! filter()" title="{{ trans('texts.refresh') }}">
<span class="glyphicon glyphicon-repeat"></span>
</span>
</div>
</div>

View File

@ -209,6 +209,11 @@
$('#filterPanel').toggle();
}
self.onClearClick = function() {
self.filter('');
$('#search').focus();
}
self.onRefreshClick = function() {
if (self.isDesktop()) {
if (model.selectedTask() && model.isChanged()) {