-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:sgasser/ember-cli-materialize int…
…o material-loader
- Loading branch information
Showing
16 changed files
with
182 additions
and
30 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
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,9 @@ | ||
import Ember from 'ember'; | ||
import layout from '../templates/components/materialize-badge'; | ||
|
||
export default Ember.Component.extend({ | ||
layout: layout, | ||
tagName: 'span', | ||
text: null, | ||
classNames: ['badge'] | ||
}); |
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 |
---|---|---|
|
@@ -14,4 +14,3 @@ export default MaterializeInputField.extend({ | |
} | ||
} | ||
}); | ||
|
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 @@ | ||
{{text}}{{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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,3 @@ | |
<small class="red-text"> | ||
{{#if errors}} {{errors.firstObject}} {{else}} {{/if}} | ||
</small> | ||
|
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,3 @@ | ||
import materializeBadge from 'ember-cli-materialize/components/materialize-badge'; | ||
|
||
export default materializeBadge; |
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
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
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,49 @@ | ||
<div class="section index-banner"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col s12 m9"> | ||
<h1 class="header">Badges</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class='container'> | ||
<div class="section"> | ||
<div class="intro"> | ||
<h4 class="col s12 header">The component supports one option:</h4> | ||
<ul> | ||
<li>text, default value <span class="default-value badge">null</span></li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="section"> | ||
<div class="row"> | ||
<div class="col s12"> | ||
<ul class="collection"> | ||
<li class="collection-item"> | ||
1. Steal Underpants | ||
{{materialize-badge class='new' text="6"}} | ||
</li> | ||
<li class="collection-item">2. ??? | ||
{{#materialize-badge}}9{{/materialize-badge}} | ||
</li> | ||
<li class="collection-item">3. Profit</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col s12"> | ||
|
||
<pre class=" language-markup"> | ||
<code class=" col s12 language-markup"> | ||
<span>{{</span>materialize-badge class="new" text="6"<span>}}</span> | ||
<span>{{</span>#materialize-badge<span>}}</span>9<span>{{</span>/materialize-badge<span>}}</span> | ||
</code> | ||
</pre> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> |
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
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,40 @@ | ||
import Ember from 'ember'; | ||
|
||
import { | ||
moduleForComponent, | ||
test | ||
} from 'ember-qunit'; | ||
|
||
moduleForComponent('materialize-badge', { | ||
// Specify the other units that are required for this test | ||
// needs: ['component:foo', 'helper:bar'] | ||
}); | ||
|
||
test('it renders', function(assert) { | ||
assert.expect(2); | ||
|
||
// Creates the component instance | ||
var component = this.subject(); | ||
assert.equal(component._state, 'preRender'); | ||
|
||
// Renders the component to the page | ||
this.render(); | ||
assert.equal(component._state, 'inDOM'); | ||
}); | ||
|
||
|
||
test('binding to the text property works', function(assert) { | ||
assert.expect(2); | ||
|
||
var component = this.subject(); | ||
|
||
this.render(); | ||
assert.equal(component.$().text().trim(), '', 'By default the text property is empty'); | ||
|
||
Ember.run(function () { | ||
component.set('text', 'Heisenberg'); | ||
Ember.run.schedule('afterRender', function () { | ||
assert.equal(component.$().text().trim(), 'Heisenberg', 'Setting the text property updates the content of the badge'); | ||
}); | ||
}); | ||
}); |
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