Skip to content

Commit

Permalink
New: Add option absolute (boolean)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirsiljkovic committed Dec 10, 2018
1 parent 4cd3b94 commit 086c042
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion jquery.popupoverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
$wrapper.css('cursor', 'pointer');
}

if (options.type == 'overlay') {
if (options.type == 'overlay' && !options.absolute) {
$wrapper.css('overflow','auto');
}

Expand Down Expand Up @@ -589,6 +589,7 @@

// Tooltip type
if (options.type == 'tooltip') {
// TODO: this static assignments should probably be moved to init method
$wrapper.css({
'position': 'absolute'
});
Expand Down Expand Up @@ -632,6 +633,7 @@

// Overlay type
} else if (options.type == 'overlay') {
// TODO all static assignments in this block should probably be moved to init method

// Horizontal position for overlay
if (options.horizontal) {
Expand All @@ -646,6 +648,13 @@
} else {
$el.css('vertical-align', 'middle');
}

if (options.absolute) {
$wrapper.css({
position: 'absolute',
top: window.scrollY
});
}
}
},

Expand Down Expand Up @@ -820,6 +829,7 @@

$.fn.popup.defaults = {
type: 'overlay',
absolute: false,
autoopen: false,
background: true,
backgroundactive: false,
Expand Down

0 comments on commit 086c042

Please sign in to comment.