2
2
* angular-ui-bootstrap
3
3
* http://angular-ui.github.io/bootstrap/
4
4
5
- * Version: 1.3.1 - 2016-04-05
5
+ * Version: 1.3.2 - 2016-04-14
6
6
* License: MIT
7
7
*/ angular . module ( "ui.bootstrap" , [ "ui.bootstrap.tpls" , "ui.bootstrap.collapse" , "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/backdrop.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" ] ) ;
@@ -1218,7 +1218,7 @@ function ($animate) {
1218
1218
1219
1219
return {
1220
1220
restrict : 'A' ,
1221
- compile : function ( tElement , tAttrs ) {
1221
+ compile : function ( tElement , tAttrs ) {
1222
1222
var linkedScopes = [ ] ;
1223
1223
var instances = [ ] ;
1224
1224
var expToData = { } ;
@@ -1237,7 +1237,7 @@ function ($animate) {
1237
1237
element : element
1238
1238
} ) ;
1239
1239
1240
- exps . forEach ( function ( exp , k ) {
1240
+ exps . forEach ( function ( exp , k ) {
1241
1241
addForExp ( exp , scope ) ;
1242
1242
} ) ;
1243
1243
@@ -1250,9 +1250,9 @@ function ($animate) {
1250
1250
var compareWithExp = matches [ 2 ] ;
1251
1251
var data = expToData [ exp ] ;
1252
1252
if ( ! data ) {
1253
- var watchFn = function ( compareWithVal ) {
1253
+ var watchFn = function ( compareWithVal ) {
1254
1254
var newActivated = null ;
1255
- instances . some ( function ( instance ) {
1255
+ instances . some ( function ( instance ) {
1256
1256
var thisVal = instance . scope . $eval ( onExp ) ;
1257
1257
if ( thisVal === compareWithVal ) {
1258
1258
newActivated = instance ;
@@ -1287,14 +1287,13 @@ function ($animate) {
1287
1287
instances . splice ( index , 1 ) ;
1288
1288
if ( linkedScopes . length ) {
1289
1289
var newWatchScope = linkedScopes [ 0 ] ;
1290
- angular . forEach ( expToData , function ( data ) {
1290
+ angular . forEach ( expToData , function ( data ) {
1291
1291
if ( data . scope === removedScope ) {
1292
1292
data . watcher = newWatchScope . $watch ( data . compareWithExp , data . watchFn ) ;
1293
1293
data . scope = newWatchScope ;
1294
1294
}
1295
1295
} ) ;
1296
- }
1297
- else {
1296
+ } else {
1298
1297
expToData = { } ;
1299
1298
}
1300
1299
}
@@ -1571,6 +1570,8 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
1571
1570
1572
1571
$scope . $emit ( 'uib:datepicker.mode' ) ;
1573
1572
}
1573
+
1574
+ $scope . $broadcast ( 'uib:datepicker.focus' ) ;
1574
1575
} ;
1575
1576
1576
1577
$scope . move = function ( direction ) {
@@ -1628,7 +1629,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
1628
1629
}
1629
1630
} ;
1630
1631
1631
- $scope . $on ( " $destroy" , function ( ) {
1632
+ $scope . $on ( ' $destroy' , function ( ) {
1632
1633
//Clear all watch listeners on destroy
1633
1634
while ( watchListeners . length ) {
1634
1635
watchListeners . shift ( ) ( ) ;
@@ -2743,7 +2744,7 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
2743
2744
2744
2745
var dates = { } ;
2745
2746
angular . forEach ( [ 'minDate' , 'maxDate' ] , function ( key ) {
2746
- if ( $scope . datepickerOptions [ key ] === null ) {
2747
+ if ( ! $scope . datepickerOptions [ key ] ) {
2747
2748
dates [ key ] = null ;
2748
2749
} else if ( angular . isDate ( $scope . datepickerOptions [ key ] ) ) {
2749
2750
dates [ key ] = dateParser . fromTimezone ( new Date ( $scope . datepickerOptions [ key ] ) , timezone ) ;
@@ -3033,10 +3034,10 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
3033
3034
. service ( 'uibDropdownService' , [ '$document' , '$rootScope' , function ( $document , $rootScope ) {
3034
3035
var openScope = null ;
3035
3036
3036
- this . open = function ( dropdownScope ) {
3037
+ this . open = function ( dropdownScope , element ) {
3037
3038
if ( ! openScope ) {
3038
3039
$document . on ( 'click' , closeDropdown ) ;
3039
- $document . on ( 'keydown' , keybindFilter ) ;
3040
+ element . on ( 'keydown' , keybindFilter ) ;
3040
3041
}
3041
3042
3042
3043
if ( openScope && openScope !== dropdownScope ) {
@@ -3046,11 +3047,11 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
3046
3047
openScope = dropdownScope ;
3047
3048
} ;
3048
3049
3049
- this . close = function ( dropdownScope ) {
3050
+ this . close = function ( dropdownScope , element ) {
3050
3051
if ( openScope === dropdownScope ) {
3051
3052
openScope = null ;
3052
3053
$document . off ( 'click' , closeDropdown ) ;
3053
- $document . off ( 'keydown' , keybindFilter ) ;
3054
+ element . off ( 'keydown' , keybindFilter ) ;
3054
3055
}
3055
3056
} ;
3056
3057
@@ -3083,6 +3084,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
3083
3084
3084
3085
var keybindFilter = function ( evt ) {
3085
3086
if ( evt . which === 27 ) {
3087
+ evt . stopPropagation ( ) ;
3086
3088
openScope . focusToggleElement ( ) ;
3087
3089
closeDropdown ( ) ;
3088
3090
} else if ( openScope . isKeynavEnabled ( ) && [ 38 , 40 ] . indexOf ( evt . which ) !== - 1 && openScope . isOpen ) {
@@ -3274,7 +3276,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
3274
3276
}
3275
3277
3276
3278
scope . focusToggleElement ( ) ;
3277
- uibDropdownService . open ( scope ) ;
3279
+ uibDropdownService . open ( scope , $element ) ;
3278
3280
} else {
3279
3281
if ( self . dropdownMenuTemplateUrl ) {
3280
3282
if ( templateScope ) {
@@ -3285,7 +3287,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
3285
3287
self . dropdownMenu = newEl ;
3286
3288
}
3287
3289
3288
- uibDropdownService . close ( scope ) ;
3290
+ uibDropdownService . close ( scope , $element ) ;
3289
3291
self . selectedOption = null ;
3290
3292
}
3291
3293
@@ -3729,8 +3731,9 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.p
3729
3731
removeAfterAnimate ( modalWindow . modalDomEl , modalWindow . modalScope , function ( ) {
3730
3732
var modalBodyClass = modalWindow . openedClass || OPENED_MODAL_CLASS ;
3731
3733
openedClasses . remove ( modalBodyClass , modalInstance ) ;
3732
- appendToElement . toggleClass ( modalBodyClass , openedClasses . hasKey ( modalBodyClass ) ) ;
3733
- if ( scrollbarPadding && scrollbarPadding . heightOverflow && scrollbarPadding . scrollbarWidth ) {
3734
+ var areAnyOpen = openedClasses . hasKey ( modalBodyClass ) ;
3735
+ appendToElement . toggleClass ( modalBodyClass , areAnyOpen ) ;
3736
+ if ( ! areAnyOpen && scrollbarPadding && scrollbarPadding . heightOverflow && scrollbarPadding . scrollbarWidth ) {
3734
3737
if ( scrollbarPadding . originalRight ) {
3735
3738
appendToElement . css ( { paddingRight : scrollbarPadding . originalRight + 'px' } ) ;
3736
3739
} else {
@@ -3864,7 +3867,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.p
3864
3867
modalBodyClass = modal . openedClass || OPENED_MODAL_CLASS ;
3865
3868
3866
3869
toggleTopWindowClass ( false ) ;
3867
-
3870
+
3868
3871
// Store the current top first, to determine what index we ought to use
3869
3872
// for the current top modal
3870
3873
previousTopOpenedModal = openedWindows . top ( ) ;
@@ -3902,6 +3905,10 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.p
3902
3905
}
3903
3906
$compile ( backdropDomEl ) ( backdropScope ) ;
3904
3907
$animate . enter ( backdropDomEl , appendToElement ) ;
3908
+ scrollbarPadding = $uibPosition . scrollbarPadding ( appendToElement ) ;
3909
+ if ( scrollbarPadding . heightOverflow && scrollbarPadding . scrollbarWidth ) {
3910
+ appendToElement . css ( { paddingRight : scrollbarPadding . right + 'px' } ) ;
3911
+ }
3905
3912
}
3906
3913
3907
3914
// Set the top modal index based on the index of the previous top modal
@@ -3919,10 +3926,6 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.p
3919
3926
angularDomEl . attr ( 'modal-animation' , 'true' ) ;
3920
3927
}
3921
3928
3922
- scrollbarPadding = $uibPosition . scrollbarPadding ( appendToElement ) ;
3923
- if ( scrollbarPadding . heightOverflow && scrollbarPadding . scrollbarWidth ) {
3924
- appendToElement . css ( { paddingRight : scrollbarPadding . right + 'px' } ) ;
3925
- }
3926
3929
appendToElement . addClass ( modalBodyClass ) ;
3927
3930
$animate . enter ( $compile ( angularDomEl ) ( modal . scope ) , appendToElement ) ;
3928
3931
@@ -4921,8 +4924,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s
4921
4924
observers . push (
4922
4925
attrs . $observe ( prefix + 'Placement' , function ( val ) {
4923
4926
ttScope . placement = val ? val : options . placement ;
4924
- var placement = $position . parsePlacement ( ttScope . placement ) ;
4925
- lastPlacement = placement [ 1 ] ? placement [ 0 ] + '-' + placement [ 1 ] : placement [ 0 ] ;
4926
4927
if ( ttScope . isOpen ) {
4927
4928
positionTooltip ( ) ;
4928
4929
}
@@ -6679,7 +6680,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
6679
6680
} ) ;
6680
6681
}
6681
6682
if ( ! isEditable && modelCtrl . $error . editable ) {
6682
- modelCtrl . $viewValue = '' ;
6683
+ modelCtrl . $setViewValue ( ) ;
6683
6684
// Reset validity as we are clearing
6684
6685
modelCtrl . $setValidity ( 'editable' , true ) ;
6685
6686
modelCtrl . $setValidity ( 'parse' , true ) ;
@@ -7276,15 +7277,15 @@ angular.module("uib/template/timepicker/timepicker.html", []).run(["$templateCac
7276
7277
" </tr>\n" +
7277
7278
" <tr>\n" +
7278
7279
" <td class=\"form-group uib-time hours\" ng-class=\"{'has-error': invalidHours}\">\n" +
7279
- " <input style=\"width:50px;\" type=\"text\" placeholder=\"HH\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementHours()\" ng-blur=\"blur()\">\n" +
7280
+ " <input type=\"text\" placeholder=\"HH\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementHours()\" ng-blur=\"blur()\">\n" +
7280
7281
" </td>\n" +
7281
7282
" <td class=\"uib-separator\">:</td>\n" +
7282
7283
" <td class=\"form-group uib-time minutes\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
7283
- " <input style=\"width:50px;\" type=\"text\" placeholder=\"MM\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementMinutes()\" ng-blur=\"blur()\">\n" +
7284
+ " <input type=\"text\" placeholder=\"MM\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementMinutes()\" ng-blur=\"blur()\">\n" +
7284
7285
" </td>\n" +
7285
7286
" <td ng-show=\"showSeconds\" class=\"uib-separator\">:</td>\n" +
7286
7287
" <td class=\"form-group uib-time seconds\" ng-class=\"{'has-error': invalidSeconds}\" ng-show=\"showSeconds\">\n" +
7287
- " <input style=\"width:50px;\" type=\"text\" placeholder=\"SS\" ng-model=\"seconds\" ng-change=\"updateSeconds()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementSeconds()\" ng-blur=\"blur()\">\n" +
7288
+ " <input type=\"text\" placeholder=\"SS\" ng-model=\"seconds\" ng-change=\"updateSeconds()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementSeconds()\" ng-blur=\"blur()\">\n" +
7288
7289
" </td>\n" +
7289
7290
" <td ng-show=\"showMeridian\" class=\"uib-time am-pm\"><button type=\"button\" ng-class=\"{disabled: noToggleMeridian()}\" class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\" ng-disabled=\"noToggleMeridian()\" tabindex=\"{{::tabindex}}\">{{meridian}}</button></td>\n" +
7290
7291
" </tr>\n" +
0 commit comments