Skip to content

Commit

Permalink
using non-existant element as container option will no longer error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogfalo committed Jul 24, 2017
1 parent 259f8cf commit bac1f04
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/date_picker/picker.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
var dialRadius = 135,
outerRadius = 105,
// innerRadius = 80 on 12 hour clock
innerRadius = 80,
innerRadius = 70,
tickRadius = 20,
diameter = dialRadius * 2,
duration = transitionSupported ? 350 : 1;
Expand Down Expand Up @@ -408,11 +408,14 @@
this.spanHours.html(this.hours);
this.spanMinutes.html(leadingZero(this.minutes));
if (!this.isAppended) {

// Append popover to input by default
if(this.options.hasOwnProperty('container'))
this.popover.appendTo(this.options.container);
else
var containerEl = document.querySelector(this.options.container);
if (this.options.container && containerEl) {
containerEl.appendChild(this.popover[0]);
} else {
this.popover.insertAfter(this.input);
}

if (this.options.twelvehour) {
if (this.amOrPm === 'PM'){
Expand Down

0 comments on commit bac1f04

Please sign in to comment.