-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix template-lint issues and update template syntax
- Loading branch information
Showing
18 changed files
with
244 additions
and
210 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
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,7 +1,7 @@ | ||
{{#ember-native-scrollable content-size=this._contentSize scroll-left=this._scrollLeft scroll-top=this._scrollTop scrollChange=(action "scrollChange") clientSizeChange=(action "clientSizeChange")}} | ||
<EmberNativeScrollable @content-size={{this._contentSize}} @scroll-left={{this._scrollLeft}} @scroll-top={{this._scrollTop}} @scrollChange={{this.scrollChange}} @clientSizeChange={{this.clientSizeChange}}> | ||
<div> | ||
{{~#each this._cells as |cell|~}} | ||
<div style={{{cell.style}}}>{{yield cell.item cell.index }}</div> | ||
{{~/each~}} | ||
</div> | ||
{{/ember-native-scrollable}} | ||
</EmberNativeScrollable> |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import Controller from '@ember/controller'; | ||
export default Controller.extend({}); | ||
|
||
export default class extends Controller {} |
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,33 +1,31 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default Controller.extend({ | ||
init() { | ||
this._super(...arguments); | ||
this.set('columns', [20, 60, 20]); | ||
}, | ||
export default class PercentagesController extends Controller { | ||
@tracked columns = [20, 60, 20]; | ||
|
||
actions: { | ||
changeColumn: function(col) { | ||
switch (col) { | ||
case 1: | ||
this.set('columns', [25, 50, 25]); | ||
break; | ||
case 2: | ||
this.set('columns', [20, 20, 40, 20]); | ||
break; | ||
case 3: | ||
this.set('columns', [33.33, 33.33, 33.33]); | ||
break; | ||
case 4: | ||
this.set('columns', [50, 50]); | ||
break; | ||
case 5: | ||
this.set('columns', [100]); | ||
break; | ||
default: | ||
this.set('columns', [50, 50]); | ||
break; | ||
} | ||
} | ||
@action | ||
changeColumn(col) { | ||
switch (col) { | ||
case 1: | ||
this.columns = [25, 50, 25]; | ||
break; | ||
case 2: | ||
this.columns = [20, 20, 40, 20]; | ||
break; | ||
case 3: | ||
this.columns = [33.33, 33.33, 33.33]; | ||
break; | ||
case 4: | ||
this.columns = [50, 50]; | ||
break; | ||
case 5: | ||
this.columns = [100]; | ||
break; | ||
default: | ||
this.columns = [50, 50]; | ||
break; | ||
} | ||
} | ||
}); | ||
} |
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,55 +1,52 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default class ScrollPositionController extends Controller { | ||
@tracked itemWidth = 100; | ||
@tracked itemHeight = 100; | ||
@tracked containerWidth = 315; | ||
@tracked containerHeight = 600; | ||
@tracked scrollLeft = 0; | ||
@tracked scrollTop = 0; | ||
|
||
@action | ||
updateContainerWidth(ev) { | ||
this.containerWidth = parseInt(ev.target.value, 10); | ||
} | ||
|
||
@action | ||
updateContainerHeight(ev) { | ||
this.containerHeight = parseInt(ev.target.value, 10); | ||
} | ||
|
||
@action | ||
makeSquare() { | ||
this.itemWidth = 100; | ||
this.itemHeight = 100; | ||
} | ||
|
||
@action | ||
makeRow() { | ||
this.itemWidth = 300; | ||
this.itemHeight = 100; | ||
} | ||
|
||
@action | ||
makeLongRect() { | ||
this.itemWidth = 100; | ||
this.itemHeight = 50; | ||
} | ||
|
||
@action | ||
makeTallRect() { | ||
this.itemWidth = 50; | ||
this.itemHeight = 100; | ||
} | ||
|
||
export default Controller.extend({ | ||
itemWidth: 100, | ||
itemHeight: 100, | ||
containerWidth: 315, | ||
containerHeight: 600, | ||
scrollLeft: 0, | ||
scrollTop: 0, | ||
|
||
actions: { | ||
updateContainerWidth: function(value) { | ||
this.set('containerWidth', parseInt(value, 10)); | ||
}, | ||
|
||
updateContainerHeight: function(value) { | ||
this.set('containerHeight', parseInt(value, 10)); | ||
}, | ||
|
||
makeSquare: function() { | ||
this.setProperties({ | ||
itemWidth: 100, | ||
itemHeight: 100, | ||
}); | ||
}, | ||
|
||
makeRow: function() { | ||
this.setProperties({ | ||
itemWidth: 300, | ||
itemHeight: 100 | ||
}); | ||
}, | ||
|
||
makeLongRect: function() { | ||
this.setProperties({ | ||
itemWidth: 100, | ||
itemHeight: 50 | ||
}); | ||
}, | ||
|
||
makeTallRect: function() { | ||
this.setProperties({ | ||
itemWidth: 50, | ||
itemHeight: 100 | ||
}); | ||
}, | ||
|
||
scrollChange: function(scrollLeft, scrollTop){ | ||
this.setProperties({ | ||
scrollLeft: scrollLeft, | ||
scrollTop: scrollTop | ||
}); | ||
} | ||
@action | ||
scrollChange(scrollLeft, scrollTop){ | ||
this.scrollLeft = scrollLeft; | ||
this.scrollTop = scrollTop; | ||
} | ||
}); | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div class="mixed" style="position:relative;height:500px"> | ||
{{#ember-collection items=this.model estimated-height=800 estimated-width=500 buffer=10 cell-layout=(mixed-grid-layout this.model) as |item|}} | ||
<EmberCollection @items={{this.model}} @estimated-height={{800}} @estimated-width={{500}} @buffer={{10}} @cell-layout={{mixed-grid-layout this.model}} as |item|> | ||
<div class="list-item"> | ||
{{item.name}} | ||
</div> | ||
{{/ember-collection}} | ||
</EmberCollection> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<button {{action 'changeColumn' 1}}>25-50-25</button> | ||
<button {{action 'changeColumn' 2}}>20-20-40-20</button> | ||
<button {{action 'changeColumn' 3}}>33-33-33</button> | ||
<button {{action 'changeColumn' 4}}>50-50</button> | ||
<button {{action 'changeColumn' 5}}>100</button> | ||
<button {{on 'click' (fn this.changeColumn 1)}}>25-50-25</button> | ||
<button {{on 'click' (fn this.changeColumn 2)}}>20-20-40-20</button> | ||
<button {{on 'click' (fn this.changeColumn 3)}}>33-33-33</button> | ||
<button {{on 'click' (fn this.changeColumn 4)}}>50-50</button> | ||
<button {{on 'click' (fn this.changeColumn 5)}}>100</button> | ||
<hr /> | ||
<div class="mixed" style="position:relative;height:500px;"> | ||
{{#ember-collection items=this.model estimated-height=800 estimated-width=1000 buffer=10 cell-layout=(percentage-columns-layout this.model.length this.columns 50) as |item|}} | ||
<EmberCollection @items={{this.model}} @estimated-height={{800}} @estimated-width={{1000}} @buffer={{10}} @cell-layout={{percentage-columns-layout this.model.length this.columns 50}} as |item|> | ||
<div class="list-item"> | ||
{{item.name}} | ||
</div> | ||
{{/ember-collection}} | ||
</EmberCollection> | ||
</div> |
Oops, something went wrong.