|
2 | 2 | * angular-ui-bootstrap
|
3 | 3 | * http://angular-ui.github.io/bootstrap/
|
4 | 4 |
|
5 |
| - * Version: 2.0.1 - 2016-08-02 |
| 5 | + * Version: 2.0.2 - 2016-08-15 |
6 | 6 | * License: MIT
|
7 | 7 | */angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse","ui.bootstrap.tabindex","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]);
|
8 | 8 | angular.module("ui.bootstrap.tpls", ["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]);
|
@@ -2727,7 +2727,11 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
|
2727 | 2727 |
|
2728 | 2728 | this.init = function(_ngModel_) {
|
2729 | 2729 | ngModel = _ngModel_;
|
2730 |
| - ngModelOptions = _ngModel_.$options; |
| 2730 | + ngModelOptions = angular.isObject(_ngModel_.$options) ? |
| 2731 | + _ngModel_.$options : |
| 2732 | + { |
| 2733 | + timezone: null |
| 2734 | + }; |
2731 | 2735 | closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ?
|
2732 | 2736 | $scope.$parent.$eval($attrs.closeOnDateSelection) :
|
2733 | 2737 | datepickerPopupConfig.closeOnDateSelection;
|
@@ -2818,13 +2822,13 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
|
2818 | 2822 | value = new Date(value);
|
2819 | 2823 | }
|
2820 | 2824 |
|
2821 |
| - $scope.date = value; |
| 2825 | + $scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone); |
2822 | 2826 |
|
2823 | 2827 | return dateParser.filter($scope.date, dateFormat);
|
2824 | 2828 | });
|
2825 | 2829 | } else {
|
2826 | 2830 | ngModel.$formatters.push(function(value) {
|
2827 |
| - $scope.date = value; |
| 2831 | + $scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone); |
2828 | 2832 | return value;
|
2829 | 2833 | });
|
2830 | 2834 | }
|
@@ -2876,7 +2880,7 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
|
2876 | 2880 |
|
2877 | 2881 | $scope.isDisabled = function(date) {
|
2878 | 2882 | if (date === 'today') {
|
2879 |
| - date = new Date(); |
| 2883 | + date = dateParser.fromTimezone(new Date(), ngModelOptions.timezone); |
2880 | 2884 | }
|
2881 | 2885 |
|
2882 | 2886 | var dates = {};
|
@@ -3023,7 +3027,7 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
|
3023 | 3027 | if (angular.isString(viewValue)) {
|
3024 | 3028 | var date = parseDateString(viewValue);
|
3025 | 3029 | if (!isNaN(date)) {
|
3026 |
| - return date; |
| 3030 | + return dateParser.fromTimezone(date, ngModelOptions.timezone); <
6D40
/code> |
3027 | 3031 | }
|
3028 | 3032 | }
|
3029 | 3033 |
|
@@ -3185,10 +3189,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
|
3185 | 3189 | if (openScope === dropdownScope) {
|
3186 | 3190 | openScope = null;
|
3187 | 3191 | $document.off('click', closeDropdown);
|
3188 |
| - var dropdownMenu = dropdownScope.getDropdownElement(); |
3189 |
| - if (dropdownMenu) { |
3190 |
| - dropdownMenu.off('keydown', this.keybindFilter); |
3191 |
| - } |
| 3192 | + $document.off('keydown', this.keybindFilter); |
3192 | 3193 | }
|
3193 | 3194 | };
|
3194 | 3195 |
|
@@ -3221,11 +3222,15 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
|
3221 | 3222 | };
|
3222 | 3223 |
|
3223 | 3224 | this.keybindFilter = function(evt) {
|
| 3225 | + var dropdownElement = openScope.getDropdownElement(); |
| 3226 | + var toggleElement = openScope.getToggleElement(); |
| 3227 | + var dropdownElementTargeted = dropdownElement && dropdownElement[0].contains(evt.target); |
| 3228 | + var toggleElementTargeted = toggleElement && toggleElement[0].contains(evt.target); |
3224 | 3229 | if (evt.which === 27) {
|
3225 | 3230 | evt.stopPropagation();
|
3226 | 3231 | openScope.focusToggleElement();
|
3227 | 3232 | closeDropdown();
|
3228 |
| - } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen) { |
| 3233 | + } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen && (dropdownElementTargeted || toggleElementTargeted)) { |
3229 | 3234 | evt.preventDefault();
|
3230 | 3235 | evt.stopPropagation();
|
3231 | 3236 | openScope.focusDropdownEntry(evt.which);
|
@@ -3417,13 +3422,11 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
|
3417 | 3422 | var newEl = dropdownElement;
|
3418 | 3423 | self.dropdownMenu.replaceWith(newEl);
|
3419 | 3424 | self.dropdownMenu = newEl;
|
3420 |
| - self.dropdownMenu.on('keydown', uibDropdownService.keybindFilter); |
| 3425 | + $document.on('keydown', uibDropdownService.keybindFilter); |
3421 | 3426 | });
|
3422 | 3427 | });
|
3423 | 3428 | } else {
|
3424 |
| - if (self.dropdownMenu) { |
3425 |
| - self.dropdownMenu.on('keydown', uibDropdownService.keybindFilter); |
3426 |
| - } |
| 3429 | + $document.on('keydown', uibDropdownService.keybindFilter); |
3427 | 3430 | }
|
3428 | 3431 |
|
3429 | 3432 | scope.focusToggleElement();
|
@@ -6433,7 +6436,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
|
6433 | 6436 | * Extracted to a separate service for ease of unit testing
|
6434 | 6437 | */
|
6435 | 6438 | .factory('uibTypeaheadParser', ['$parse', function($parse) {
|
6436 |
| - // 00000111000000000000022200000000000000003333333333333330000000000044000 |
| 6439 | + // 000001111111100000000000002222222200000000000000003333333333333330000000000044444444000 |
6437 | 6440 | var TYPEAHEAD_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;
|
6438 | 6441 | return {
|
6439 | 6442 | parse: function(input) {
|
|
0 commit comments