Skip to content

fix popup positioning #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build/css/tempusdominus-bootstrap-3-standalone.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*@preserve
* Tempus Dominus Bootstrap3 v5.0.0-alpha10 (https://tempusdominus.github.io/bootstrap-3/)
* Copyright 2016-2020 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/

/*@preserve
* Tempus Dominus Bootstrap3 v5.0.0-alpha10 (https://tempusdominus.github.io/bootstrap-3/)
* Copyright 2016-2018 Jonathan Peterson
Expand Down
4 changes: 2 additions & 2 deletions build/css/tempusdominus-bootstrap-3.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*@preserve
* Tempus Dominus Bootstrap3 v5.0.0-alpha10 (https://tempusdominus.github.io/bootstrap-3/)
* Copyright 2016-2018 Jonathan Peterson
* Copyright 2016-2020 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/

Expand Down Expand Up @@ -274,7 +274,7 @@
width: 54px;
}
.bootstrap-datetimepicker-widget table td.cw {
font-size: .8em;
font-size: 0.8em;
height: 20px;
line-height: 20px;
color: #777777;
Expand Down
2 changes: 1 addition & 1 deletion build/css/tempusdominus-bootstrap-3.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions build/js/tempusdominus-bootstrap-3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*@preserve
* Tempus Dominus Bootstrap3 v5.0.0-alpha10 (https://tempusdominus.github.io/bootstrap-3/)
* Copyright 2016-2018 Jonathan Peterson
* Copyright 2016-2020 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/

Expand Down Expand Up @@ -410,6 +410,11 @@ var DateTimePicker = function ($, moment) {
if (!this._options.allowMultidate || this._dates.length === 1) {
this.unset = true;
this._dates = [];

// https://github.com/tempusdominus/bootstrap-4/issues/34#issuecomment-414392321
this._dates[0] = this.getMoment();
this._viewDate[0] = this.getMoment().clone();

this._datesFormatted = [];
} else {
outpValue = this._element.data('date') + ',';
Expand Down Expand Up @@ -1886,15 +1891,15 @@ var TempusDominusBootstrap3 = function ($) {
self.widget.removeClass('pull-right');
}

// find the first parent element that has a static css positioning
if (parent.css('position') !== 'static') {
// find the first parent element that has a relative css positioning
if (parent.css('position') !== 'relative') {
parent = parent.parents().filter(function () {
return $(this).css('position') === 'static';
return $(this).css('position') === 'relative';
}).first();
}

if (parent.length === 0) {
throw new Error('datetimepicker component should be placed within a static positioned container');
throw new Error('datetimepicker component should be placed within a relative positioned container');
}

self.widget.css({
Expand Down
8 changes: 1 addition & 7 deletions build/js/tempusdominus-bootstrap-3.min.js

Large diffs are not rendered by default.

Loading