Skip to content

Commit

Permalink
Packing v0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
indrimuska committed Sep 20, 2016
1 parent 1716218 commit 0ab77e1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-moment-picker",
"version": "0.6.2",
"version": "0.6.3",
"authors": [
"Indri Muska <indrimuska@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-moment-picker.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Angular Moment Picker - v0.6.2 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
/*! Angular Moment Picker - v0.6.3 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
.moment-picker { position: relative; display: block; }
.moment-picker .moment-picker-contents { cursor: pointer; }
.moment-picker .moment-picker-container { color: #404040; min-width: 15em; background: #fff; padding: 4px; border: 1px solid #f0f3f4; border-radius: 4px; position: absolute;
Expand Down
20 changes: 13 additions & 7 deletions dist/angular-moment-picker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Angular Moment Picker - v0.6.2 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
/*! Angular Moment Picker - v0.6.3 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
(function (angular) {
'use strict';

Expand Down Expand Up @@ -227,12 +227,14 @@
update: function () { $scope.view.value = $scope.momentToDate($scope.view.moment); },
toggle: function () { $scope.view.isOpen ? $scope.view.close() : $scope.view.open(); },
open: function () {
if ($scope.disabled) return;
if ($scope.disabled || $scope.view.isOpen) return;

$scope.view.isOpen = true;
$timeout($scope.view.position, 0, false);
},
close: function () {
if (!$scope.view.isOpen) return;

$scope.view.isOpen = false;
$scope.view.selected = $scope.startView;
},
Expand Down Expand Up @@ -675,11 +677,15 @@

// event listeners
$scope.input
.on('focus', function () { if (!$scope.view.isOpen) $scope.$apply($scope.view.open); })
.on('blur', function () { $timeout(function () { if ($scope.view.isOpen && document.activeElement !== $scope.input[0]) $scope.view.close(); }, 100); })
.on('keydown', function (e) { if ($scope.keyboard) $scope.$apply(function () { $scope.view.keydown(e); }); });
$scope.contents.on('click', function () { $scope.input[0].focus(); });
$scope.container.on('click', function () { $scope.input[0].focus(); });
.on('focus', function () { $scope.$evalAsync($scope.view.open); })
.on('blur', function () { $scope.$evalAsync($scope.view.close); })
.on('keydown', function (e) { if ($scope.keyboard) $scope.$evalAsync(function () { $scope.view.keydown(e); }); });
$scope.contents.on('mousedown', $scope.focusInput);
$scope.container.on('mousedown', $scope.focusInput);
$scope.focusInput = function (e) {
e.preventDefault();
$scope.input[0].focus();
};
angular.element($window).on('resize scroll', $scope.view.position);
};

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-moment-picker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0ab77e1

Please sign in to comment.