Browse Source

merge

master
Frank.Qiu 7 years ago
parent
commit
ef19012f7f
  1. 157
      .eslintrc
  2. 58
      bi/case.js
  3. 1
      bi/widget.js
  4. 14
      demo/js/config/fix.js
  5. 59
      dist/bundle.js
  6. 10
      dist/bundle.min.js
  7. 58
      dist/case.js
  8. 14
      dist/demo.js
  9. 2
      dist/fix/fix.js
  10. 1
      dist/widget.js
  11. 4
      src/case/richeditor/bar/action.richeditor.js
  12. 28
      src/case/richeditor/bar/texttoolbar.js
  13. 8
      src/case/richeditor/plugins/combo.backgroundcolorchooser.js
  14. 6
      src/case/richeditor/plugins/combo.colorchooser.js
  15. 10
      src/case/richeditor/plugins/combo.sizechooser.js
  16. 2
      src/case/richeditor/richeditor.js

157
.eslintrc

@ -0,0 +1,157 @@
{
"extends": "eslint:recommended",
"rules": {
// 声明
"no-use-before-define": "error",
//禁止定义前使用
// 对象
"no-dupe-keys": "error",
// 禁止在对象字面量中出现重复的键
"quote-props": [
"error",
"as-needed"
],
// 对象属性只在需要的时候加引号
// 字符串
"quotes": [
"error",
"double",
{
"allowTemplateLiterals": true
}
],
// 字符串开头和结束使用双引号
"no-useless-concat": "error",
// 禁止没有必要的字符拼接
"no-useless-escape": "error",
// 禁用不必要的转义
// 函数
"no-dupe-args": "error",
// 禁止在 function 定义中出现重复的参数
"space-before-function-paren": "error",
// 函数括号前必须要有空格
// 变量
"no-undef": "error",
// 禁止使用未声明的变量
// 比较运算符 & 相等运算符
"eqeqeq": "error",
// 使用 === 和 !== 代替 == 和 !=
"no-unneeded-ternary": "error",
//禁止可以在有更简单的可替代的表达式时使用三元操作符
// 条件
"default-case": "error",
// 要求 Switch 语句中有 Default 分支
"no-else-return": "error",
// 如果 if 块中包含了一个 return 语句,else 块就成了多余的了。可以将其内容移至块外
// 代码块
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
// 代码块左括号紧跟上一行结束
"curly": [
"error",
"multi-line"
],
// if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号
// 注释
"spaced-comment": "error",
// 注释前有空格
// 空白
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
// 缩进控制4空格
"no-mixed-spaces-and-tabs": "error",
// 禁止使用 空格 和 tab 混合缩进
"space-before-blocks": [
"error",
"always"
],
// 语句块之前的需要有空格
"space-infix-ops": ["error", {
"int32Hint": false
}], // 要求中缀操作符周围有空格,设置 int32Hint 选项为 true (默认 false) 允许 a|0 不带空格
"no-trailing-spaces": ["error", {
"skipBlankLines": true
}], // 禁用行尾空格
"key-spacing": ["error", {
"afterColon": true
}], // 要求在对象字面量的冒号和值之间存在至少有一个空格
// 逗号
"comma-style": "error",
// 逗号必须放在行末
"comma-dangle": [
"error",
"never"
],
// 多行对象字面量中要求不要拖尾逗号
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
//在变量声明、数组字面量、对象字面量、函数参数 和 序列中禁止在逗号前使用空格,要求在逗号后使用一个或多个空格
// 分号
"semi": "error",
//不得省略语句结束的分号
"semi-spacing": [
"error",
{
"before": false,
"after": true
}
],
//禁止分号周围的空格
"no-extra-semi": "error",
// 禁用不必要的分号
// 类型转换
"no-extra-boolean-cast": "error",
// 禁止不必要的布尔类型转换
// 其他最佳实践或规范
"no-unexpected-multiline": "error",
// 禁止使用令人困惑的多行表达式
"no-unreachable": "error",
// 禁止在 return、throw、continue 和 break 语句后出现不可达代码
"valid-typeof": "error",
// 强制 typeof 表达式与有效的字符串进行比较
"no-new-wrappers": "error"
// 禁止通过 new 操作符使用 String、Number 和 Boolean
},
"globals": {
"window": true,
"$": true,
"WebUI": true,
"BI": true,
"BICst": true,
"Data": true,
"Fix": true,
"module": true
}
}

58
bi/case.js

@ -9419,6 +9419,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
keydown: function () { keydown: function () {
}, },
hideIf: function (e) {
},
activate: function () { activate: function () {
}, },
@ -9552,7 +9556,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
{type: "bi.rich_editor_align_left_button"}, {type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"}, {type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"}, {type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"}, {type: "bi.rich_editor_param_button"}
], ],
height: 28 height: 28
}); });
@ -9561,22 +9565,28 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
var buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: BI.map(o.buttons, function (i, btn) { items: buttons,
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3, hgap: 3,
vgap: 3 vgap: 3
}) });
}, },
mounted: function () { mounted: function () {
var self = this; var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 if (BI.isIE9Below()) {// IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () { this.element.mousedown(function () {
self._noSelect(self.element[0]); self._noSelect(self.element[0]);
}); });
@ -9585,15 +9595,15 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
}, },
_noSelect: function (element) { _noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { if (element.setAttribute && element.nodeName.toLowerCase() != "input" && element.nodeName.toLowerCase() != "textarea") {
element.setAttribute('unselectable', 'on'); element.setAttribute("unselectable", "on");
} }
for (var i = 0; i < element.childNodes.length; i++) { for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]); this._noSelect(element.childNodes[i]);
} }
} }
}); });
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
* 富文本编辑器 * 富文本编辑器
* *
* Created by GUY on 2017/9/15. * Created by GUY on 2017/9/15.
@ -10281,10 +10291,16 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
}); });
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
} }
}); });
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** BI.shortcut("bi.rich_editor_background_color_chooser", BI.RichEditorBackgroundColorChooser);/**
* 颜色选择 * 颜色选择
* *
* Created by GUY on 2015/11/26. * Created by GUY on 2015/11/26.
@ -10320,6 +10336,12 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
this.colorchooser.setValue(""); this.colorchooser.setValue("");
} }
@ -10396,10 +10418,16 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
self.doCommand(val); self.doCommand(val);
this.hideView(); this.hideView();
this.setValue([]); this.setValue([]);
}) });
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
} }
}); });
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);/**
* 富文本编辑器 * 富文本编辑器
* *
* Created by GUY on 2017/9/15. * Created by GUY on 2017/9/15.
@ -10430,7 +10458,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
type: "bi.combo", type: "bi.combo",
element: this, element: this,
toggle: false, toggle: false,
direction: "top", direction: "top,left",
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: false,
adjustLength: 1, adjustLength: 1,

1
bi/widget.js

@ -17223,7 +17223,6 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
listeners: [{ listeners: [{
eventName: BI.SingleSelectPopupView.EVENT_CHANGE, eventName: BI.SingleSelectPopupView.EVENT_CHANGE,
action: function () { action: function () {
console.log(this.getValue())
self.storeValue = this.getValue(); self.storeValue = this.getValue();
self._adjust(function () { self._adjust(function () {
assertShowValue(); assertShowValue();

14
demo/js/config/fix.js

@ -94,37 +94,37 @@ Demo.FIX_CONFIG = [{
text: "state属性", text: "state属性",
value: "demo.fix_state" value: "demo.fix_state"
}, { }, {
id: 78, id: 73,
pId: 7, pId: 7,
text: "计算属性", text: "计算属性",
value: "demo.fix_computed" value: "demo.fix_computed"
}, { }, {
id: 73, id: 74,
pId: 7, pId: 7,
text: "store", text: "store",
value: "demo.fix_store" value: "demo.fix_store"
}, { }, {
id: 74, id: 75,
pId: 7, pId: 7,
text: "watcher且或表达式", text: "watcher且或表达式",
value: "demo.fix_watcher" value: "demo.fix_watcher"
}, { }, {
id: 75, id: 76,
pId: 7, pId: 7,
text: "watcher星号表达式", text: "watcher星号表达式",
value: "demo.fix_global_watcher" value: "demo.fix_global_watcher"
}, { }, {
id: 76, id: 77,
pId: 7, pId: 7,
text: "context", text: "context",
value: "demo.fix_context" value: "demo.fix_context"
}, { }, {
id: 77, id: 78,
pId: 7, pId: 7,
text: "一个混合的例子", text: "一个混合的例子",
value: "demo.fix" value: "demo.fix"
}, { }, {
id: 78, id: 79,
pId: 7, pId: 7,
text: "场景", text: "场景",
value: "demo.fix_scene" value: "demo.fix_scene"

59
dist/bundle.js vendored

@ -70881,6 +70881,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
keydown: function () { keydown: function () {
}, },
hideIf: function (e) {
},
activate: function () { activate: function () {
}, },
@ -71014,7 +71018,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
{type: "bi.rich_editor_align_left_button"}, {type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"}, {type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"}, {type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"}, {type: "bi.rich_editor_param_button"}
], ],
height: 28 height: 28
}); });
@ -71023,22 +71027,28 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
var buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: BI.map(o.buttons, function (i, btn) { items: buttons,
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3, hgap: 3,
vgap: 3 vgap: 3
}) });
}, },
mounted: function () { mounted: function () {
var self = this; var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 if (BI.isIE9Below()) {// IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () { this.element.mousedown(function () {
self._noSelect(self.element[0]); self._noSelect(self.element[0]);
}); });
@ -71047,15 +71057,15 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
}, },
_noSelect: function (element) { _noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { if (element.setAttribute && element.nodeName.toLowerCase() != "input" && element.nodeName.toLowerCase() != "textarea") {
element.setAttribute('unselectable', 'on'); element.setAttribute("unselectable", "on");
} }
for (var i = 0; i < element.childNodes.length; i++) { for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]); this._noSelect(element.childNodes[i]);
} }
} }
}); });
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
* 富文本编辑器 * 富文本编辑器
* *
* Created by GUY on 2017/9/15. * Created by GUY on 2017/9/15.
@ -71743,10 +71753,16 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
}); });
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
} }
}); });
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** BI.shortcut("bi.rich_editor_background_color_chooser", BI.RichEditorBackgroundColorChooser);/**
* 颜色选择 * 颜色选择
* *
* Created by GUY on 2015/11/26. * Created by GUY on 2015/11/26.
@ -71782,6 +71798,12 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
this.colorchooser.setValue(""); this.colorchooser.setValue("");
} }
@ -71858,10 +71880,16 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
self.doCommand(val); self.doCommand(val);
this.hideView(); this.hideView();
this.setValue([]); this.setValue([]);
}) });
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
} }
}); });
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);/**
* 富文本编辑器 * 富文本编辑器
* *
* Created by GUY on 2017/9/15. * Created by GUY on 2017/9/15.
@ -71892,7 +71920,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
type: "bi.combo", type: "bi.combo",
element: this, element: this,
toggle: false, toggle: false,
direction: "top", direction: "top,left",
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: false,
adjustLength: 1, adjustLength: 1,
@ -92452,7 +92480,6 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
listeners: [{ listeners: [{
eventName: BI.SingleSelectPopupView.EVENT_CHANGE, eventName: BI.SingleSelectPopupView.EVENT_CHANGE,
action: function () { action: function () {
console.log(this.getValue())
self.storeValue = this.getValue(); self.storeValue = this.getValue();
self._adjust(function () { self._adjust(function () {
assertShowValue(); assertShowValue();

10
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

58
dist/case.js vendored

@ -9419,6 +9419,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
keydown: function () { keydown: function () {
}, },
hideIf: function (e) {
},
activate: function () { activate: function () {
}, },
@ -9552,7 +9556,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
{type: "bi.rich_editor_align_left_button"}, {type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"}, {type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"}, {type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"}, {type: "bi.rich_editor_param_button"}
], ],
height: 28 height: 28
}); });
@ -9561,22 +9565,28 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
var buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: BI.map(o.buttons, function (i, btn) { items: buttons,
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3, hgap: 3,
vgap: 3 vgap: 3
}) });
}, },
mounted: function () { mounted: function () {
var self = this; var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 if (BI.isIE9Below()) {// IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () { this.element.mousedown(function () {
self._noSelect(self.element[0]); self._noSelect(self.element[0]);
}); });
@ -9585,15 +9595,15 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
}, },
_noSelect: function (element) { _noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { if (element.setAttribute && element.nodeName.toLowerCase() != "input" && element.nodeName.toLowerCase() != "textarea") {
element.setAttribute('unselectable', 'on'); element.setAttribute("unselectable", "on");
} }
for (var i = 0; i < element.childNodes.length; i++) { for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]); this._noSelect(element.childNodes[i]);
} }
} }
}); });
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
* 富文本编辑器 * 富文本编辑器
* *
* Created by GUY on 2017/9/15. * Created by GUY on 2017/9/15.
@ -10281,10 +10291,16 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
}); });
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
} }
}); });
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** BI.shortcut("bi.rich_editor_background_color_chooser", BI.RichEditorBackgroundColorChooser);/**
* 颜色选择 * 颜色选择
* *
* Created by GUY on 2015/11/26. * Created by GUY on 2015/11/26.
@ -10320,6 +10336,12 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
this.colorchooser.setValue(""); this.colorchooser.setValue("");
} }
@ -10396,10 +10418,16 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
self.doCommand(val); self.doCommand(val);
this.hideView(); this.hideView();
this.setValue([]); this.setValue([]);
}) });
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
} }
}); });
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);/**
* 富文本编辑器 * 富文本编辑器
* *
* Created by GUY on 2017/9/15. * Created by GUY on 2017/9/15.
@ -10430,7 +10458,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
type: "bi.combo", type: "bi.combo",
element: this, element: this,
toggle: false, toggle: false,
direction: "top", direction: "top,left",
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: false,
adjustLength: 1, adjustLength: 1,

14
dist/demo.js vendored

@ -5268,37 +5268,37 @@ Demo.FIX_CONFIG = [{
text: "state属性", text: "state属性",
value: "demo.fix_state" value: "demo.fix_state"
}, { }, {
id: 78, id: 73,
pId: 7, pId: 7,
text: "计算属性", text: "计算属性",
value: "demo.fix_computed" value: "demo.fix_computed"
}, { }, {
id: 73, id: 74,
pId: 7, pId: 7,
text: "store", text: "store",
value: "demo.fix_store" value: "demo.fix_store"
}, { }, {
id: 74, id: 75,
pId: 7, pId: 7,
text: "watcher且或表达式", text: "watcher且或表达式",
value: "demo.fix_watcher" value: "demo.fix_watcher"
}, { }, {
id: 75, id: 76,
pId: 7, pId: 7,
text: "watcher星号表达式", text: "watcher星号表达式",
value: "demo.fix_global_watcher" value: "demo.fix_global_watcher"
}, { }, {
id: 76, id: 77,
pId: 7, pId: 7,
text: "context", text: "context",
value: "demo.fix_context" value: "demo.fix_context"
}, { }, {
id: 77, id: 78,
pId: 7, pId: 7,
text: "一个混合的例子", text: "一个混合的例子",
value: "demo.fix" value: "demo.fix"
}, { }, {
id: 78, id: 79,
pId: 7, pId: 7,
text: "场景", text: "场景",
value: "demo.fix_scene" value: "demo.fix_scene"

2
dist/fix/fix.js vendored

@ -1159,7 +1159,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return vm.$$state[key]; return vm.$$state[key];
} }
if (vm.$$model && key in vm.$$model) { if (vm.$$model && key in vm.$$model) {
return vm.$$model; return vm.$$model[key];
} }
var p = vm._parent; var p = vm._parent;
while (p) { while (p) {

1
dist/widget.js vendored

@ -17223,7 +17223,6 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
listeners: [{ listeners: [{
eventName: BI.SingleSelectPopupView.EVENT_CHANGE, eventName: BI.SingleSelectPopupView.EVENT_CHANGE,
action: function () { action: function () {
console.log(this.getValue())
self.storeValue = this.getValue(); self.storeValue = this.getValue();
self._adjust(function () { self._adjust(function () {
assertShowValue(); assertShowValue();

4
src/case/richeditor/bar/action.richeditor.js

@ -65,6 +65,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
keydown: function () { keydown: function () {
}, },
hideIf: function (e) {
},
activate: function () { activate: function () {
}, },

28
src/case/richeditor/bar/texttoolbar.js

@ -19,7 +19,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
{type: "bi.rich_editor_align_left_button"}, {type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"}, {type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"}, {type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"}, {type: "bi.rich_editor_param_button"}
], ],
height: 28 height: 28
}); });
@ -28,22 +28,28 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
var buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: BI.map(o.buttons, function (i, btn) { items: buttons,
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3, hgap: 3,
vgap: 3 vgap: 3
}) });
}, },
mounted: function () { mounted: function () {
var self = this; var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 if (BI.isIE9Below()) {// IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () { this.element.mousedown(function () {
self._noSelect(self.element[0]); self._noSelect(self.element[0]);
}); });
@ -52,12 +58,12 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
}, },
_noSelect: function (element) { _noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { if (element.setAttribute && element.nodeName.toLowerCase() != "input" && element.nodeName.toLowerCase() != "textarea") {
element.setAttribute('unselectable', 'on'); element.setAttribute("unselectable", "on");
} }
for (var i = 0; i < element.childNodes.length; i++) { for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]); this._noSelect(element.childNodes[i]);
} }
} }
}); });
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar); BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);

8
src/case/richeditor/plugins/combo.backgroundcolorchooser.js

@ -37,7 +37,13 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
}); });
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
} }
}); });
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser); BI.shortcut("bi.rich_editor_background_color_chooser", BI.RichEditorBackgroundColorChooser);

6
src/case/richeditor/plugins/combo.colorchooser.js

@ -34,6 +34,12 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}, },
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () { deactivate: function () {
this.colorchooser.setValue(""); this.colorchooser.setValue("");
} }

10
src/case/richeditor/plugins/combo.sizechooser.js

@ -70,7 +70,13 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
self.doCommand(val); self.doCommand(val);
this.hideView(); this.hideView();
this.setValue([]); this.setValue([]);
}) });
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
} }
}); });
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser); BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);

2
src/case/richeditor/richeditor.js

@ -29,7 +29,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
type: "bi.combo", type: "bi.combo",
element: this, element: this,
toggle: false, toggle: false,
direction: "top", direction: "top,left",
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: false,
adjustLength: 1, adjustLength: 1,

Loading…
Cancel
Save