Skip to content

Commit

Permalink
BREAKING(get rid of inner component) (#81)
Browse files Browse the repository at this point in the history
* {{ember-attacher}} is now {{attach-popover}}
* `class` is now passed to the inner div; CSS references to `.inner` should be removed
* The popper.js div itself is now hidden/shown, and receives aria-hidden
  • Loading branch information
kybishop authored Nov 3, 2017
1 parent b4fce8a commit 733dc03
Show file tree
Hide file tree
Showing 32 changed files with 498 additions and 472 deletions.
13 changes: 9 additions & 4 deletions addon-test-support/is-visible.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { find } from 'ember-native-dom-helpers';

export function isVisible(selector, contextEl) {
const inner = typeof(selector) === 'string' ? find(`${selector} > .inner`, contextEl)
: find('.inner', selector);
const attachment = typeof(selector) === 'string' ? getAttachment(selector, contextEl) : selector;

if (!inner) {
return attachment.style.display !== 'none';
}

function getAttachment(selector, contextEl) {
const attachment = find(selector, contextEl);

if (!attachment) {
const msg = typeof(selector) === 'string' ? selector : selector.innerHTML;

throw `Could not locate attachment from selector: ${msg}`;
}

return inner.style.display !== 'none';
return attachment;
}
Loading

0 comments on commit 733dc03

Please sign in to comment.