ColumnBreak_wev8.js 936 Bytes
define(['mUtil', "Component"],function(mUtil, Component) {
	var ColumnBreak = function(options) {
        
		Component.super(this, options);
        
		this.type = "ColumnBreak";
		this.tpl = this.type + "_html";
		this.css = this.type + "_css";
		
		var vm = this.viewModel = {
			content : "",
			color : "#333",
			fontWeight : "normal",
			fontSize : 14,
			align : "left",
			btn: {
				enabled: false,
				text: "",
				click: function(){}
			}
		};
		
		this.beforeMount = function(){
			vm.fontSize = (parseFloat(vm.fontSize) || 14) + "px";
		};
		
		this.mounted = function(){
			var that = this;
			var $comp = this.$el.children(".wev-comp-" + this.type);
			var compHeight = $comp.children("div").height();

			if(compHeight > 36){
				$comp.height(compHeight);
			}
			
			$(".nav-btn", $comp).on("click", function(){
				mUtil.eval(vm.btn.click, that.pageid);
			});
		};
    };

    return Component.init(ColumnBreak);
});