Skip to content

Commit

Permalink
Allow tooltips in icons (#802)
Browse files Browse the repository at this point in the history
* expose icon yield to allow tooltips
* update changelog
  • Loading branch information
Subtletree authored and miguelcobain committed Aug 30, 2017
1 parent a558e79 commit 6e53d67
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Contributions and pull requests are always welcome. Contributors may often be fo
- Flex and layout attributes are replaced by classes (see [the documentation](http://miguelcobain.github.io/ember-paper/#/layout/introduction)). `flex=true` on Ember Paper components has also been removed and replaced by classes.

### master
- [#802](https://github.com/miguelcobain/ember-paper/pull/802) allow icons to have tooltips
- [#772](https://github.com/miguelcobain/ember-paper/pull/772) fix tabs ink-bar in dialogs
- [db3b46c](https://github.com/miguelcobain/ember-paper/commit/db3b46cb3f7c6090b1fb5707c841a855fd5a4de5) paper-tooltip is now a tagless component and proxies `class` attributes to the tooltip element class

Expand Down
3 changes: 2 additions & 1 deletion addon/templates/components/paper-icon.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{{-paper-underscore iconClass}}
{{-paper-underscore iconClass}}
{{yield}}
8 changes: 8 additions & 0 deletions tests/dummy/app/templates/demo/tooltip.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
Delete
{{/paper-tooltip}}
{{/paper-button}}

<div>
{{#paper-icon "info"}}
{{#paper-tooltip position=position}}
Icon tooltip
{{/paper-tooltip}}
{{/paper-icon}}
</div>
{{! END-SNIPPET tooltip }}
</div>

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/components/paper-icon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ test('it renders with classes', function(assert) {

assert.ok($component.hasClass('paper-icon'));
assert.ok($component.hasClass('material-icons'));
assert.equal($component.text(), 'foo');
assert.equal($component.text().trim(), 'foo');
this.set('icon', 'bar');
assert.equal($component.text(), 'bar');
assert.notEqual($component.text(), 'foo');
assert.equal($component.text().trim(), 'bar');
assert.notEqual($component.text().trim(), 'foo');
});

test('it renders with spin class', function(assert) {
Expand Down

0 comments on commit 6e53d67

Please sign in to comment.