ColumnBreak_wev8.js
936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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);
});