This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -601,6 +601,20 @@ describe('timepicker directive', function () {
601
601
} ) ;
602
602
} ) ;
603
603
604
+ describe ( '`readonly-input` attribute' , function ( ) {
605
+ beforeEach ( inject ( function ( ) {
606
+ $rootScope . meridiansArray = [ 'am' , 'pm' ] ;
607
+ element = $compile ( '<timepicker ng-model="time" readonly-input="true"></timepicker>' ) ( $rootScope ) ;
608
+ $rootScope . $digest ( ) ;
609
+ } ) ) ;
610
+
611
+ it ( 'should make inputs readonly' , function ( ) {
612
+ var inputs = element . find ( 'input' ) ;
613
+ expect ( inputs . eq ( 0 ) . attr ( 'readonly' ) ) . toBe ( 'readonly' ) ;
614
+ expect ( inputs . eq ( 1 ) . attr ( 'readonly' ) ) . toBe ( 'readonly' ) ;
615
+ } ) ;
616
+ } ) ;
617
+
604
618
describe ( 'setting timepickerConfig steps' , function ( ) {
605
619
var originalConfig = { } ;
606
620
beforeEach ( inject ( function ( _$compile_ , _$rootScope_ , timepickerConfig ) {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ angular.module('ui.bootstrap.timepicker', [])
26
26
this . setupMousewheelEvents ( hoursInputEl , minutesInputEl ) ;
27
27
}
28
28
29
- $scope . readonlyInput = angular . isDefined ( $attrs . readonlyInput ) ? scope . $parent . $eval ( $attrs . readonlyInput ) : timepickerConfig . readonlyInput ;
29
+ $scope . readonlyInput = angular . isDefined ( $attrs . readonlyInput ) ? $ scope. $parent . $eval ( $attrs . readonlyInput ) : timepickerConfig . readonlyInput ;
30
30
this . setupInputEvents ( hoursInputEl , minutesInputEl ) ;
31
31
} ;
32
32
@@ -243,7 +243,7 @@ angular.module('ui.bootstrap.timepicker', [])
243
243
replace : true ,
244
244
scope : { } ,
245
245
templateUrl : 'template/timepicker/timepicker.html' ,
246
- link : function ( sscope , element , attrs , ctrls ) {
246
+ link : function ( scope , element , attrs , ctrls ) {
247
247
var timepickerCtrl = ctrls [ 0 ] , ngModelCtrl = ctrls [ 1 ] ;
248
248
249
249
if ( ngModelCtrl ) {
You can’t perform that action at this time.
0 commit comments