/Src/WS.EKA.Portal/Scripts/models/catalog.js
JavaScript | 43 lines | 37 code | 6 blank | 0 comment | 0 complexity | c02ef6fbdf66783a85f0557f03663256 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause
- var catalogData = [
- { href: "#", src: "/Content/Images/catalog/myhome.png", text: "??ShopNum1", type: "myhome" },
- { href: "#", src: "/Content/Images/catalog/categorys.png", text: "????", type: "categorys" },
- { href: "#", src: "/Content/Images/catalog/collect.png", text: "????", type: "collect" },
- { href: "#", src: "/Content/Images/catalog/message.png", text: "????", type: "message" },
- { href: "#", src: "/Content/Images/catalog/ebook.png", text: "???", type: "buyer" },
- { href: "#", src: "/Content/Images/catalog/band.png", text: "????", type: "order" }
- ];
- window.Catalog = Backbone.Model.extend({
- defaults: {
- href: "#",
- src: "/Content/Images/catalog/myhome.png",
- text: "??ShopNum1"
- }
- });
- window.CatalogCollection = Backbone.Collection.extend({
- model: Catalog
- });
- window.CatalogView = Backbone.View.extend({
- el: "#jqt",
- initialize: function () {
- this.collection = new CatalogCollection(catalogData);
- this.template = $('#IndexCatalogTemplate').html();
- },
- render: function () {
- var partial = { header: $('#HeaderTemplate').html(), footer: $('#FooterTemplate').html(), innerFooter: $('#InnerFooterTemplate').html() };
- var data = { hasLogo: true, btnListR: [{ name: 'avatar' }, { name: 'cart'}], btnListL: [{ name: 'sort'}],
- list: this.collection.toJSON()
- };
- this.$el.append(Mustache.render(this.template, data, partial));
- new Plugins.SearchPlugin('#Catalog .searchContainer', {
- id: 'keyword_catalog',
- isGlobalSearch:true
- });
- return this;
- }
- });