You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
690 B
JavaScript

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

//import ItemFilter from './ItemFilter.js';
import ItemListing from './ItemListing.js';
function cmp_fn(a,b){
var A = (a.model+a.color).toUpperCase(); // ignore upper and lowercase
var B = (b.model+b.color).toUpperCase(); // ignore upper and lowercase
  if (A < B) {
return -1;
  }
  else if (A > B) {
return 1;
  }
else{ // names must be equal
  return 0;
}
}
function ItemBrowser(initialVnode) {
return {
view: function(vnode) {
var items = vnode.attrs.items
items.sort(cmp_fn);
return m(".item-browser.container", [
//m(ItemFilter),
m(ItemListing, {items: items})
]);
}
}
}
export default ItemBrowser