CountPanel_wev8.js 602 Bytes
define(['mUtil', "Component"],function(mUtil, Component) {
	var comp = function(options) {
		
		Component.super(this, options);
		
		this.type = "CountPanel";
		this.tpl = this.type + "_html";
		this.css = this.type + "_css";
		
		var vm = this.viewModel = {
			items:[]
		};
		
		this.mounted = function() {
			var that = this;
			var $comp = this.$el.children(".wev-comp-" + this.type);
			
			$comp.children("a").on("click", function(){
				var index = $(this).index(),
					item = vm.items[index];
				item && mUtil.eval(item.click, that.pageid);
			});
		};
	};
	
	return Component.init(comp);
});