|
@@ -3,8 +3,27 @@
|
|
* date 2018-04-11
|
|
* date 2018-04-11
|
|
* Description:
|
|
* Description:
|
|
*/
|
|
*/
|
|
-const boxContent = function() {
|
|
|
|
-
|
|
|
|
|
|
+var boxContent = function(style) {
|
|
|
|
+ this.top = style.top || '10px';
|
|
|
|
+ this.left = style.left || '10px';
|
|
|
|
+ this.width = style.width || '310px';
|
|
|
|
+ this.height = style.height || '50px';
|
|
|
|
+ this.isEditor = style.isEditor || false;
|
|
};
|
|
};
|
|
|
|
|
|
-boxContent.prototype.boxTpl = '<div class="line-n line resizable"><div class="circle"></div></div><div class="line-e line resizable"><div class="circle"></div></div><div class="line-s line resizable"><div class="circle"></div></div><div class="line-w line resizable"><div class="circle"></div></div><div class="circle-nw circle resizable"></div><div class="circle-ne circle resizable"></div><div class="circle-se circle resizable"></div><div class="circle-sw circle resizable"></div>';
|
|
|
|
|
|
+boxContent.prototype.boxTpl = '<div class="line-n line resizable"><div class="circle"></div></div><div class="line-e line resizable"><div class="circle"></div></div><div class="line-s line resizable"><div class="circle"></div></div><div class="line-w line resizable"><div class="circle"></div></div><div class="circle-nw circle resizable"></div><div class="circle-ne circle resizable"></div><div class="circle-se circle resizable"></div><div class="circle-sw circle resizable"></div>';
|
|
|
|
+
|
|
|
|
+boxContent.prototype.addContent = function () {
|
|
|
|
+ // 实例化主件
|
|
|
|
+ let outDom = $('<div class="outer-box"></div>');
|
|
|
|
+ let elementBoxDom = $('<div class="element-box-contents"></div>');
|
|
|
|
+ let editorDom = $('<div class="element comp_paragraph editable-text"></div>');
|
|
|
|
+ let circleDom = $('<div class="eqc-select"></div>');
|
|
|
|
+ editorDom.text('双击此处进行编辑');
|
|
|
|
+ editorDom.css({ width: this.width, height: this.height, 'pointer-events': this.isEditor ? 'all' : 'none' });
|
|
|
|
+ elementBoxDom.append(editorDom.context());
|
|
|
|
+ outDom.css({ width: this.width, height: this.height,top: this.top, left: this.left }).append(elementBoxDom.context());
|
|
|
|
+ circleDom.append(this.boxTpl);
|
|
|
|
+ outDom.append(circleDom.context());
|
|
|
|
+ return outDom.context();
|
|
|
|
+};
|