Browse Source

Popup will not appear on hidden elements

pull/2092/head
jlukic 10 years ago
parent
commit
d0b451290b
2 changed files with 6 additions and 1 deletions
  1. 1
      RELEASE-NOTES.md
  2. 6
      src/definitions/modules/popup.js

1
RELEASE-NOTES.md

@ -119,6 +119,7 @@
- **Modal** - Modal with `detachable: false` inside `ui sidebar` `pusher` element will now show correctly
- **Popup** - Fixes issue with `min-width` in firefox exceeding `max-width` causing element to not wrap correctly
- **Popup** - Popup will now produce an error message and not mistakenly appear in the top left corner of page, if called with a `popup` or `target` that does not exist.
- **Popup** - Popup will no longer appear incorrectly if the targeted element is not visible on page
- **Popup** - Fixed bug which could cause pre-existing inline popup to be removed from DOM after hiding
- **Reveal** - Removed `masked` reveal, all reveals are masked by default
- **Search** - Search will no longer incorrectly produce an error when API settings are passed through metadata

6
src/definitions/modules/popup.js

@ -604,7 +604,6 @@ $.fn.popup = function(parameters) {
module.error(error.notFound);
return;
}
var
windowWidth = $(window).width(),
windowHeight = $(window).height(),
@ -642,6 +641,11 @@ $.fn.popup = function(parameters) {
position = position || $module.data(metadata.position) || settings.position;
arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset;
if(target.top == 0 && target.left == 0) {
module.debug('Popup target is hidden, no action taken');
return false;
}
if(searchDepth == settings.maxSearchDepth && settings.lastResort) {
module.debug('Using last resort position to display', settings.lastResort);
position = settings.lastResort;

Loading…
Cancel
Save