mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
add insideParent property
This commit is contained in:
parent
2801f1a8b1
commit
ebc3c8630e
@ -636,7 +636,8 @@ var datetimepickerFactory = function ($) {
|
||||
beforeShowDay: null,
|
||||
|
||||
enterLikeTab: true,
|
||||
showApplyButton: false
|
||||
showApplyButton: false,
|
||||
insideParent: false,
|
||||
};
|
||||
|
||||
var dateHelper = null,
|
||||
@ -1355,8 +1356,11 @@ var datetimepickerFactory = function ($) {
|
||||
.append(calendar)
|
||||
.append(applyButton);
|
||||
|
||||
$(options.parentID)
|
||||
.append(datetimepicker);
|
||||
if (options.insideParent) {
|
||||
$(input).parent().append(datetimepicker);
|
||||
} else {
|
||||
$(options.parentID).append(datetimepicker);
|
||||
}
|
||||
|
||||
XDSoft_datetime = function () {
|
||||
var _this = this;
|
||||
@ -2182,7 +2186,7 @@ var datetimepickerFactory = function ($) {
|
||||
}
|
||||
});
|
||||
|
||||
if (dateInputHasFixedAncestor) {
|
||||
if (dateInputHasFixedAncestor && !options.insideParent) {
|
||||
position = 'fixed';
|
||||
|
||||
//If the picker won't fit entirely within the viewport then display it above the date input.
|
||||
@ -2222,12 +2226,16 @@ var datetimepickerFactory = function ($) {
|
||||
|
||||
datetimepickerCss = {
|
||||
position: position,
|
||||
left: left,
|
||||
left: options.insideParent ? dateInputElem.offsetLeft : left,
|
||||
top: '', //Initialize to prevent previous values interfering with new ones.
|
||||
bottom: '' //Initialize to prevent previous values interfering with new ones.
|
||||
};
|
||||
|
||||
if (options.insideParent) {
|
||||
datetimepickerCss[verticalAnchorEdge] = dateInputElem.offsetTop + dateInputElem.offsetHeight;
|
||||
} else {
|
||||
datetimepickerCss[verticalAnchorEdge] = verticalPosition;
|
||||
}
|
||||
|
||||
datetimepicker.css(datetimepickerCss);
|
||||
};
|
||||
|
2
build/jquery.datetimepicker.full.min.js
vendored
2
build/jquery.datetimepicker.full.min.js
vendored
File diff suppressed because one or more lines are too long
2
build/jquery.datetimepicker.min.js
vendored
2
build/jquery.datetimepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -627,7 +627,8 @@ var datetimepickerFactory = function ($) {
|
||||
beforeShowDay: null,
|
||||
|
||||
enterLikeTab: true,
|
||||
showApplyButton: false
|
||||
showApplyButton: false,
|
||||
insideParent: false,
|
||||
};
|
||||
|
||||
var dateHelper = null,
|
||||
@ -1346,8 +1347,11 @@ var datetimepickerFactory = function ($) {
|
||||
.append(calendar)
|
||||
.append(applyButton);
|
||||
|
||||
$(options.parentID)
|
||||
.append(datetimepicker);
|
||||
if (options.insideParent) {
|
||||
$(input).parent().append(datetimepicker);
|
||||
} else {
|
||||
$(options.parentID).append(datetimepicker);
|
||||
}
|
||||
|
||||
XDSoft_datetime = function () {
|
||||
var _this = this;
|
||||
@ -2173,7 +2177,7 @@ var datetimepickerFactory = function ($) {
|
||||
}
|
||||
});
|
||||
|
||||
if (dateInputHasFixedAncestor) {
|
||||
if (dateInputHasFixedAncestor && !options.insideParent) {
|
||||
position = 'fixed';
|
||||
|
||||
//If the picker won't fit entirely within the viewport then display it above the date input.
|
||||
@ -2213,12 +2217,16 @@ var datetimepickerFactory = function ($) {
|
||||
|
||||
datetimepickerCss = {
|
||||
position: position,
|
||||
left: left,
|
||||
left: options.insideParent ? dateInputElem.offsetLeft : left,
|
||||
top: '', //Initialize to prevent previous values interfering with new ones.
|
||||
bottom: '' //Initialize to prevent previous values interfering with new ones.
|
||||
};
|
||||
|
||||
if (options.insideParent) {
|
||||
datetimepickerCss[verticalAnchorEdge] = dateInputElem.offsetTop + dateInputElem.offsetHeight;
|
||||
} else {
|
||||
datetimepickerCss[verticalAnchorEdge] = verticalPosition;
|
||||
}
|
||||
|
||||
datetimepicker.css(datetimepickerCss);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user