-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a real component for md-tabs-canvas
- Loading branch information
Showing
6 changed files
with
67 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @module ember-paper | ||
*/ | ||
import Component from 'ember-component'; | ||
import computed from 'ember-computed'; | ||
import layout from '../templates/components/paper-tabs-canvas'; | ||
|
||
/** | ||
* @class PaperTabsCanvas | ||
* @extends Component | ||
*/ | ||
export default Component.extend({ | ||
|
||
tagName: 'md-tabs-canvas', | ||
|
||
layout, | ||
|
||
/* Inherited from {{paper-tabs-wrapper}} */ | ||
shouldPaginate: computed.readOnly('parentComponent.shouldPaginate'), | ||
shouldCenterTabs: computed.readOnly('parentComponent.shouldCenterTabs'), | ||
|
||
classNameBindings: [ | ||
'shouldPaginate:md-paginated', | ||
'shouldCenterTabs:md-center-tabs' | ||
] | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{yield}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-paper/components/paper-tabs-canvas'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
moduleForComponent('paper-tabs-canvas', 'Integration | Component | paper tabs canvas', { | ||
integration: true, | ||
beforeEach() { | ||
this.set('parentComponent', (function() { | ||
return { | ||
wormhole: 'wormhole', | ||
send() {}, | ||
registerChild() {}, | ||
unregisterChild() {} | ||
}; | ||
})()); | ||
} | ||
}); | ||
|
||
test('it add md-paginated to canvas if parentComponent.shouldPaginate is true', function(assert) { | ||
this.set('parentComponent.shouldPaginate', true); | ||
|
||
this.render(hbs`{{#paper-tabs-canvas parentComponent=parentComponent}} | ||
block content | ||
{{/paper-tabs-canvas}}`); | ||
|
||
assert.ok(this.$('md-tabs-canvas').hasClass('md-paginated')); | ||
}); | ||
|
||
test('it add md-center-tabs to canvas if parentComponent.shouldCenterTabs is true', function(assert) { | ||
this.set('parentComponent.shouldCenterTabs', true); | ||
|
||
this.render(hbs`{{#paper-tabs-canvas parentComponent=parentComponent}} | ||
block content | ||
{{/paper-tabs-canvas}}`); | ||
|
||
assert.ok(this.$('md-tabs-canvas').hasClass('md-center-tabs')); | ||
}); |