Skip to content

Commit

Permalink
fix(calendar): support dynamic way to append popup instead of prepend…
Browse files Browse the repository at this point in the history
…ing to the parent

Closes #699
  • Loading branch information
lubber-de authored and Sean committed Jun 10, 2019
1 parent 52bfd66 commit 1acf30e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ $.fn.calendar = function(parameters) {
if (!$container.length) {
//prepend the popup element to the activator's parent so that it has less chance of messing with
//the styling (eg input action button needs to be the last child to have correct border radius)
$container = $('<div/>').addClass(className.popup).prependTo($activator.parent());
var $activatorParent = $activator.parent(),
domPositionFunction = $activatorParent.closest(selector.append).length !== 0 ? 'appendTo' : 'prependTo';
$container = $('<div/>').addClass(className.popup)[domPositionFunction]($activatorParent);
}
$container.addClass(className.calendar);
var onVisible = settings.onVisible;
Expand Down Expand Up @@ -1504,7 +1506,8 @@ $.fn.calendar.settings = {
selector: {
popup: '.ui.popup',
input: 'input',
activator: 'input'
activator: 'input',
append: '.inline.field,.inline.fields'
},

regExp: {
Expand Down

0 comments on commit 1acf30e

Please sign in to comment.