forked from Addepar/ember-table
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Addepar#37 from Cuiyansong/row-loading-indicator-c…
…omponent Row loading indicator component
- Loading branch information
Showing
7 changed files
with
44 additions
and
12 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,17 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.View.extend({ | ||
templateName: 'row-loading-indicator', | ||
|
||
classNameBindings: ['indicatorClass'], | ||
|
||
isLoading: false, | ||
|
||
indicatorClass: Ember.computed(function() { | ||
var classNames = ['row-loading-indicator']; | ||
if (this.get('isLoading')) { | ||
classNames.push('loading'); | ||
} | ||
return classNames.join(' '); | ||
}).property('isLoading') | ||
}); |
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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{{#if view.isLoading}} | ||
<img class="loading-indicator" src="/ember-table/images/loading.gif" width="75px" height="15px"> | ||
{{view "row-loading-indicator" | ||
isLoading=view.isLoading | ||
}} | ||
{{else}} | ||
{{view view.indicatorView | ||
hasChildren=view.hasChildren | ||
isExpanded=view.isExpanded | ||
expandLevel=view.expandLevel | ||
}} | ||
<span class="ember-table-content"> | ||
{{view.cellContent}} | ||
</span> | ||
{{view view.indicatorView | ||
hasChildren=view.hasChildren | ||
isExpanded=view.isExpanded | ||
expandLevel=view.expandLevel | ||
}} | ||
<span class="ember-table-content"> | ||
{{view.cellContent}} | ||
</span> | ||
{{/if}} |
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 @@ | ||
<img class="loading-indicator" src="/ember-table/images/loading.gif" width="75px" height="15px"> |
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 RowLoadingIndicator from 'ember-table/views/row-loading-indicator'; | ||
|
||
export default RowLoadingIndicator; |
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