Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds ok button and deletes 'instantaneously disappearing option' after ... #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/ng-quick-date-default-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ table.quickdate-calendar {
margin: 3px 1px 0;
}

.quickdate-clear {
.quickdate-button {
display: inline-block;
padding: 2px 4px;
background-color: @button-bg-color;
color: @button-text-color;
border: solid 1px @button-border-color;
Expand All @@ -122,5 +121,3 @@ table.quickdate-calendar {
background-color: darken(@button-bg-color, 5%);
}
}


7 changes: 4 additions & 3 deletions src/ng-quick-date.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ app.directive "quickDatepicker", ['ngQuickDateDefaults', '$filter', '$sce', (ngQ
# * Clicking a day on the calendar or from the `selectDateFromInput`
# * Changing the date or time inputs, which call the `selectDateFromInput` method, which calls this method.
# * The clear button is clicked
scope.selectDate = (date, closeCalendar=true) ->
scope.selectDate = (date, closeCalendar=false) ->
changed = (!ngModelCtrl.$viewValue && date) || (ngModelCtrl.$viewValue && !date) || ((date && ngModelCtrl.$viewValue) && (date.getTime() != ngModelCtrl.$viewValue.getTime()))
if typeof(scope.dateFilter) == 'function' && !scope.dateFilter(date)
return false
ngModelCtrl.$setViewValue(date)
if closeCalendar
scope.toggleCalendar(false)
scope.toggleCalendar(true)
true

# This is triggered when the date or time inputs have a blur or enter event.
Expand Down Expand Up @@ -381,7 +381,8 @@ app.directive "quickDatepicker", ['ngQuickDateDefaults', '$filter', '$sce', (ngQ
</tbody>
</table>
<div class='quickdate-popup-footer'>
<a href='' class='quickdate-clear' tabindex='-1' ng-hide='disableClearButton' ng-click='clear()'>Clear</a>
<a href='' class='quickdate-button' tabindex='-1' ng-click='toggleCalendar()'>OK</a>
<a href='' class='quickdate-button' tabindex='-1' ng-hide='disableClearButton' ng-click='clear()'>Clear</a>
</div>
</div>
</div>
Expand Down