22/*jslint vars:true */
33
44/**
5- * @license angular-bootstrap-datetimepicker v0.3.2
5+ * @license angular-bootstrap-datetimepicker v0.3.3
66 * (c) 2013-2014 Knight Rider Consulting, Inc. http://www.knightrider.com
77 * License: MIT
88 */
@@ -20,7 +20,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
2020 minView : 'minute' ,
2121 startView : 'day'
2222 } )
23- . directive ( 'datetimepicker' , [ 'dateTimePickerConfig' , function ( defaultConfig ) {
23+ . directive ( 'datetimepicker' , [ '$log' , ' dateTimePickerConfig', function ( $log , defaultConfig ) {
2424 "use strict" ;
2525
2626 function DateObject ( ) {
@@ -31,6 +31,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
3131 var validProperties = [ 'dateValue' , 'display' , 'active' , 'selectable' , 'past' , 'future' ] ;
3232
3333 for ( var prop in arguments [ 0 ] ) {
34+ /* istanbul ignore else */
3435 //noinspection JSUnfilteredForInLoop
3536 if ( validProperties . indexOf ( prop ) >= 0 ) {
3637 //noinspection JSUnfilteredForInLoop
@@ -305,7 +306,14 @@ angular.module('ui.bootstrap.datetimepicker', [])
305306 scope . ngModel = newDate ;
306307
307308 if ( configuration . dropdownSelector ) {
308- jQuery ( configuration . dropdownSelector ) . dropdown ( 'toggle' ) ;
309+
310+ /* istanbul ignore else */
311+ if ( typeof jQuery !== 'undefined' ) {
312+ jQuery ( configuration . dropdownSelector ) . dropdown ( 'toggle' ) ;
313+ } else {
314+ $log . error ( "Please DO NOT specify the dropdownSelector option unless you are using jQuery. " +
315+ "Please include jQuery or write code to close the dropdown in the on-set-time callback. " ) ;
316+ }
309317 }
310318
311319 scope . onSetTime ( { newDate : scope . ngModel , oldDate : oldDate } ) ;
0 commit comments