-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(virtual-repeat): implement native scrolling
With this commit the virtual-repeat now leverages the browser's native scroll and scroll bar. This should make a more maintainable code base and out of the box give the users expected look and feel across browsers, platforms and devices. Closes #14 #23 #25
- Loading branch information
1 parent
e9a27a6
commit dc486a9
Showing
13 changed files
with
620 additions
and
735 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,16 +1,16 @@ | ||
{ | ||
"jspm": { | ||
"dependencies": { | ||
"aurelia-animator-css": "github:aurelia/animator-css@^0.17.0", | ||
"aurelia-binding": "github:aurelia/binding@^0.9.1", | ||
"aurelia-bootstrapper": "github:aurelia/bootstrapper@^0.18.0", | ||
"aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.11.2", | ||
"aurelia-framework": "github:aurelia/framework@^0.16.0", | ||
"aurelia-http-client": "github:aurelia/http-client@^0.11.0", | ||
"aurelia-logging-console": "github:aurelia/logging-console@^0.8.0", | ||
"aurelia-metadata": "github:aurelia/metadata@^0.8.0", | ||
"aurelia-path": "github:aurelia/path@^0.10.0", | ||
"aurelia-templating": "github:aurelia/templating@^0.16.0", | ||
"aurelia-animator-css": "npm:aurelia-animator-css@^1.0.0-beta.1.0.1", | ||
"aurelia-binding": "npm:aurelia-binding@^1.0.0-beta.1.0.2", | ||
"aurelia-bootstrapper": "npm:aurelia-bootstrapper@^1.0.0-beta.1", | ||
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0-beta.1", | ||
"aurelia-framework": "npm:aurelia-framework@^1.0.0-beta.1.0.3", | ||
"aurelia-http-client": "npm:aurelia-http-client@^1.0.0-beta.1", | ||
"aurelia-logging-console": "npm:aurelia-logging-console@^1.0.0-beta.1", | ||
"aurelia-metadata": "npm:aurelia-metadata@^1.0.0-beta.1", | ||
"aurelia-path": "npm:aurelia-path@^1.0.0-beta.1", | ||
"aurelia-templating": "npm:aurelia-templating@^1.0.0-beta.1.0.1", | ||
"bootstrap": "github:twbs/bootstrap@^3.3.5", | ||
"css": "github:systemjs/plugin-css@^0.1.19", | ||
"font-awesome": "npm:font-awesome@^4.4.0", | ||
|
@@ -21,7 +21,9 @@ | |
"devDependencies": { | ||
"babel": "npm:babel-core@^5.8.22", | ||
"babel-runtime": "npm:babel-runtime@^5.8.20", | ||
"core-js": "npm:core-js@^1.1.0" | ||
"core-js": "npm:core-js@^1.1.0", | ||
"traceur": "github:jmcriffey/[email protected]", | ||
"traceur-runtime": "github:jmcriffey/[email protected]" | ||
} | ||
}, | ||
"devDependencies": { | ||
|
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,24 +1,74 @@ | ||
<template> | ||
<div class="contact-list"> | ||
<div> | ||
<div virtual-repeat.for="item of objectArray" class="contact-list-item"> | ||
<div class="contact-item"> | ||
<div class="avatar" style="background-color: ${item.color}">${item.firstLetter}</div> | ||
<div class="name"> | ||
${$index} ${item.name} | ||
</div> | ||
<div class="content"> | ||
<strong>Phone:</strong> ${item.phone} <br /> | ||
<strong>Country:</strong> ${item.country} <br /> | ||
</div> | ||
</div> | ||
<div class="contact-list" if.bind="viewStrategy === 'div'"> | ||
<div if.bind="isVisible"> | ||
<div virtual-repeat.for="item of objectArray" class="contact-list-item ${item.name}"> | ||
<div class="contact-item"> | ||
<div class="avatar" click.delegate="click()" css="background-color: ${item.color}">${item.firstLetter}</div> | ||
<div class="name"> | ||
${item.name} | ||
</div> | ||
<div class="content"> | ||
<strong>Phone:</strong> ${item.phone} <br /> | ||
<strong>Country:</strong> ${item.country} <br /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="contact-list" if.bind="viewStrategy === 'table'"> | ||
<table if.bind="isVisible"> | ||
<tr virtual-repeat.for="item of objectArray" class="contact-list-item ${item.name}"> | ||
<td width="85"> | ||
<div class="avatar" click.delegate="click()" css="background-color: ${item.color}">${item.firstLetter}</div> | ||
</td> | ||
<td> | ||
<div class="contact-item"> | ||
|
||
<div class="name"> | ||
${item.name} | ||
</div> | ||
<div class="content"> | ||
<strong>Phone:</strong> ${item.phone} <br /> | ||
<strong>Country:</strong> ${item.country} <br /> | ||
</div> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
<div class="contact-list" if.bind="viewStrategy === 'ul'"> | ||
<ul if.bind="isVisible"> | ||
<li virtual-repeat.for="item of objectArray" class="contact-list-item ${item.name}"> | ||
<div class="contact-item"> | ||
<div class="avatar" click.delegate="click()" css="background-color: ${item.color}">${item.firstLetter}</div> | ||
<div class="name"> | ||
${item.name} | ||
</div> | ||
<div class="content"> | ||
<strong>Phone:</strong> ${item.phone} <br /> | ||
<strong>Country:</strong> ${item.country} <br /> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="array-actions"> | ||
<button class="btn btn-primary" click.delegate="addItem()">Add 1</button> | ||
<button class="btn btn-primary" click.delegate="addItems(1000)">Add 1000</button> | ||
<button class="btn btn-primary" click.delegate="addItems(10000)">Add 10 000</button> | ||
<button class="btn btn-primary" click.delegate="addItemFirst()">Add 1 at top</button> | ||
<button class="btn btn-primary" click.delegate="addItemLast()">Add 1 at bottom</button> | ||
<button class="btn btn-primary" click.delegate="removeItems(1)">Remove 1 at top</button> | ||
<button class="btn btn-primary" click.delegate="removeLast()">Remove 1 at bottom</button> | ||
<button class="btn btn-primary" click.delegate="toggle()">Toggle visibility</button> | ||
<button class="btn btn-primary" click.delegate="swap()">Swap</button> | ||
|
||
<br /><br /> | ||
|
||
<button class="btn ${viewStrategy === 'div' ? 'btn-danger' : ''}" click.trigger="setViewStrategy('div')">Div</button> | ||
<button class="btn ${viewStrategy === 'table' ? 'btn-danger' : ''}" click.trigger="setViewStrategy('table')">Table</button> | ||
<button class="btn ${viewStrategy === 'ul' ? 'btn-danger' : ''}" click.trigger="setViewStrategy('ul')">UL</button> | ||
</div> | ||
</template> |
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
Oops, something went wrong.