Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Issue 35/can 5 upgrade #43

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
node_js: 7.3
cache: yarn
addons:
firefox: "51.0"
43 changes: 22 additions & 21 deletions examples/bit-c3.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,45 @@
<!-- Template to load -->
<script type="text/stache" id="demo-html" can-autorender>
<can-import from="bit-c3" />
{{# if(dataColumns) }}
Bit-C3 {{ dataColumns.length }}
<bit-c3>
<bit-c3-data>
{{#each ../dataColumns column=value}}
{{#each(../dataColumns, column=value)}}
<bit-c3-data-column value:from="column.data" />
<bit-c3-data-name key:from="key" value:from="column.label" />
{{/each}}
</bit-c3-data>
</bit-c3>
{{/ if }}
</script>

<!-- Loading Script -->
<script src="../node_modules/steal/steal.js" id="demo-source" main="can-view-autorender">
import DefineList from "can-define/list/list";
import DefineMap from "can-define/map/map";
import canViewModel from "can-view-model";
import domData from "can-util/dom/data/data";
<script src="../node_modules/steal/steal.js" id="demo-source" main="can">
import { DefineList, DefineMap, viewModel } from "can";

var data1 = { key: 'data1', label: 'Data 1', data: new DefineList(['data1', 30, 200, 100, 400, 150, 250]) },
data2 = { key: 'data2', label: 'Data 2', data: new DefineList(['data2', 50, 20, 10, 40, 15, 25]) },
data3 = { key: 'data3', label: 'Data 3', data: new DefineList(['data3', 130, 150, 200, 300, 200, 100]) };

var element = document.getElementById("demo-html");
var vm = new DefineMap({
dataColumns: new DefineList([data1, data2])
});
domData.set.call(element, "viewModel", vm);
var vm = viewModel(element)
console.log('vm', vm)
vm.set({
dataColumns: new DefineList([data1, data2])
})

window.setTimeout(() => {
data1.data.replace([230, 190, 300, 500, 300, 400]);
}, 2000);

window.setTimeout(() => {
vm.dataColumns.push(data3);
}, 300);

window.setTimeout(() => {
vm.dataColumns.shift();
}, 4000);
//window.setTimeout(() => {
// data1.data.replace([230, 190, 300, 500, 300, 400]);
//}, 2000);
//
//window.setTimeout(() => {
// vm.dataColumns.push(data3);
//}, 300);
//
//window.setTimeout(() => {
// vm.dataColumns.shift();
//}, 4000);
</script>
</body>
</html>
Expand Down
Loading