diff --git a/cosmoz-data-nav.js b/cosmoz-data-nav.js index 84eaf14..a907622 100644 --- a/cosmoz-data-nav.js +++ b/cosmoz-data-nav.js @@ -156,7 +156,7 @@ type: Object, notify: true, readOnly: true, - computed: '_getItem(selected, items)' + computed: '_getItem(selected, items.*)' }, /** @@ -601,7 +601,8 @@ } _getItem(index, items = this.items) { - return items[index]; + const arr = items.base ? items.base : items; + return arr[index]; } _resetElement(index) { diff --git a/demo/index.html b/demo/index.html index ab714ea..c3073ac 100644 --- a/demo/index.html +++ b/demo/index.html @@ -52,6 +52,7 @@

Basic cosmoz-data-nav.

@@ -92,6 +94,9 @@

Basic cosmoz-data-nav.

basic.computeJSON = function (index) { return JSON.stringify(this.items[index]); }; + basic.toJSON = function (item) { + return JSON.stringify(item); + }; basic.set('items', items); }); @@ -100,4 +105,4 @@

Basic cosmoz-data-nav.

- \ No newline at end of file +