Skip to content

Commit

Permalink
add backwards compatibility for tooltipIsVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
a15n committed Sep 29, 2016
1 parent 5045c4c commit 110c0fa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addon/components/tooltip-and-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export default EmberTetherComponent.extend({
spacing: 10,
tabindex: '0', // A positive integer (to enable) or -1 (to disable)
isShown: false,
tooltipIsVisible: computed.deprecatingAlias('isShown', {
id: 'tooltip-and-popover.tooltipIsVisible',
until: '3.0.0',
}),
keepInWindow: true,

/*
Expand Down
20 changes: 20 additions & 0 deletions tests/integration/components/tooltip-is-visible-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ test('It toggles with isShown', function(assert) {
assertHide(assert, this);

});

test('It toggles with tooltipIsVisible', function(assert) {
// tooltipIsVisible is deprecated in favor of isShown
// tooltipIsVisible will be supported until v3.0.0

assert.expect(2);

this.set('showTooltip', true);

this.render(hbs`{{tooltip-on-component tooltipIsVisible=showTooltip}}`);

assertShow(assert, this);

run(() => {
this.set('showTooltip', false);
});

assertHide(assert, this);

});

0 comments on commit 110c0fa

Please sign in to comment.