diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 18335594e..0aa54de07 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -17,207 +17,203 @@ Demo.Button = BI.inherit(BI.Widget, { level: "success", height: 30 } - }, - { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示错误状态的按钮", - level: "error", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "一般按钮", - block: true, - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - block: true, - level: "success", - height: 30 - } - }, - { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - block: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - block: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - block: true, - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - block: true, - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - block: true, - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "一般按钮", - clear: true, - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - clear: true, - level: "success", - height: 30 - } - }, - { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - clear: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - clear: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - clear: true, - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - clear: true, - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - clear: true, - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.text_button", - text: "文字按钮", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "幽灵按钮(common)", - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - text: "幽灵按钮(common)灰化", - disabled: true, - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - text: "弹出bubble", - bubble: function () { - return BI.parseInt(Math.random() * 100) % 10 + "提示" - }, - handler: function () { - BI.Msg.toast("1111"); - }, - height: 30 - } - } - ]; + }, { + el: { + type: "bi.button", + text: "表示警告状态的按钮", + level: "warning", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示错误状态的按钮", + level: "error", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示忽略状态的按钮", + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "普通灰化按钮", + disabled: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "忽略状态灰化按钮", + disabled: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "带图标的按钮", + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "一般按钮", + block: true, + level: "common", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示成功状态按钮", + block: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示警告状态的按钮", + block: true, + level: "warning", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示忽略状态的按钮", + block: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "普通灰化按钮", + block: true, + disabled: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "忽略状态灰化按钮", + block: true, + disabled: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "带图标的按钮", + block: true, + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "一般按钮", + clear: true, + level: "common", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示成功状态按钮", + clear: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示警告状态的按钮", + clear: true, + level: "warning", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示忽略状态的按钮", + clear: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "普通灰化按钮", + clear: true, + disabled: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "忽略状态灰化按钮", + clear: true, + disabled: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "带图标的按钮", + clear: true, + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, { + el: { + type: "bi.text_button", + text: "文字按钮", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "幽灵按钮(common)", + ghost: true, + height: 30 + } + }, { + el: { + type: "bi.button", + text: "幽灵按钮(common)灰化", + disabled: true, + ghost: true, + height: 30 + } + }, { + el: { + type: "bi.button", + text: "弹出bubble", + bubble: function () { + return BI.parseInt(Math.random() * 100) % 10 + "提示" + }, + handler: function () { + BI.Msg.toast("1111"); + }, + height: 30 + } + }]; // BI.each(items, function (i, item) { // item.el.handler = function () { // BI.Msg.alert("按钮", this.options.text); diff --git a/dist/demo.js b/dist/demo.js index 30bc91d72..e944c763f 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -39,207 +39,203 @@ $(function () { level: "success", height: 30 } - }, - { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示错误状态的按钮", - level: "error", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "一般按钮", - block: true, - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - block: true, - level: "success", - height: 30 - } - }, - { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - block: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - block: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - block: true, - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - block: true, - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - block: true, - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "一般按钮", - clear: true, - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - clear: true, - level: "success", - height: 30 - } - }, - { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - clear: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - clear: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - clear: true, - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - clear: true, - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - clear: true, - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.text_button", - text: "文字按钮", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "幽灵按钮(common)", - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - text: "幽灵按钮(common)灰化", - disabled: true, - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - text: "弹出bubble", - bubble: function () { - return BI.parseInt(Math.random() * 100) % 10 + "提示" - }, - handler: function () { - BI.Msg.toast("1111"); - }, - height: 30 - } + }, { + el: { + type: "bi.button", + text: "表示警告状态的按钮", + level: "warning", + height: 30 } - ]; + }, { + el: { + type: "bi.button", + text: "表示错误状态的按钮", + level: "error", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示忽略状态的按钮", + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "普通灰化按钮", + disabled: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "忽略状态灰化按钮", + disabled: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "带图标的按钮", + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "一般按钮", + block: true, + level: "common", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示成功状态按钮", + block: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示警告状态的按钮", + block: true, + level: "warning", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示忽略状态的按钮", + block: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "普通灰化按钮", + block: true, + disabled: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "忽略状态灰化按钮", + block: true, + disabled: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "带图标的按钮", + block: true, + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "一般按钮", + clear: true, + level: "common", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示成功状态按钮", + clear: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示警告状态的按钮", + clear: true, + level: "warning", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "表示忽略状态的按钮", + clear: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "普通灰化按钮", + clear: true, + disabled: true, + level: "success", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "忽略状态灰化按钮", + clear: true, + disabled: true, + level: "ignore", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "带图标的按钮", + clear: true, + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, { + el: { + type: "bi.text_button", + text: "文字按钮", + height: 30 + } + }, { + el: { + type: "bi.button", + text: "幽灵按钮(common)", + ghost: true, + height: 30 + } + }, { + el: { + type: "bi.button", + text: "幽灵按钮(common)灰化", + disabled: true, + ghost: true, + height: 30 + } + }, { + el: { + type: "bi.button", + text: "弹出bubble", + bubble: function () { + return BI.parseInt(Math.random() * 100) % 10 + "提示" + }, + handler: function () { + BI.Msg.toast("1111"); + }, + height: 30 + } + }]; // BI.each(items, function (i, item) { // item.el.handler = function () { // BI.Msg.alert("按钮", this.options.text); diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index 5eaeb7718..ddda99782 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -21,6 +21,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, { this.combo = BI.createWidget({ type: "bi.combo", element: this, + container: o.container, adjustLength: 1, isNeedAdjustWidth: false, isNeedAdjustHeight: false, diff --git a/src/case/colorchooser/colorchooser.simple.js b/src/case/colorchooser/colorchooser.simple.js index 75244d174..2753b2e3c 100644 --- a/src/case/colorchooser/colorchooser.simple.js +++ b/src/case/colorchooser/colorchooser.simple.js @@ -21,6 +21,7 @@ BI.SimpleColorChooser = BI.inherit(BI.Widget, { this.combo = BI.createWidget({ type: "bi.color_chooser", element: this, + container: o.container, value: o.value, popup: { type: "bi.simple_color_chooser_popup" diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index c6368d5ad..6146a03f4 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -36,6 +36,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { element: this, trigger: o.trigger, toggle: o.toggle, + container: o.container, direction: o.direction, isDefaultInit: o.isDefaultInit, destroyWhenHide: o.destroyWhenHide, diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index 068d3394f..26414187a 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -44,6 +44,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { this.textIconCombo = BI.createWidget({ type: "bi.combo", element: this, + container: o.container, adjustLength: 2, el: this.trigger, popup: { diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index cada57d89..403d93f5b 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -19,6 +19,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { items: [{ el: { type: "bi.combo", + container: o.container, adjustLength: 2, toggle: false, ref: function () { diff --git a/src/case/combo/staticcombo/combo.static.js b/src/case/combo/staticcombo/combo.static.js index c8d90773b..4aa61377d 100644 --- a/src/case/combo/staticcombo/combo.static.js +++ b/src/case/combo/staticcombo/combo.static.js @@ -45,6 +45,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, { type: "bi.combo", element: this, adjustLength: 2, + container: o.container, el: this.trigger, popup: { el: this.popup diff --git a/src/case/richeditor/niceditor/niceditor.js b/src/case/richeditor/niceditor/niceditor.js index 441eec3b3..4f755cdd6 100644 --- a/src/case/richeditor/niceditor/niceditor.js +++ b/src/case/richeditor/niceditor/niceditor.js @@ -68,7 +68,7 @@ var self = this; var found = false; do { - if (t.nodeName !== "svg" && t.className && t.className.indexOf(prefix) != -1) { + if (t.nodeName !== "svg" && t.className && t.className.indexOf && t.className.indexOf(prefix) != -1) { return; // return false; } diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index cb2cba8ae..dafaa3a1e 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -119,6 +119,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.combo = BI.createWidget({ type: "bi.combo", toggle: false, + container: o.container, el: this.trigger, adjustLength: 1, popup: { diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index e824477b2..3200c287b 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -114,6 +114,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { toggle: false, el: this.trigger, adjustLength: 1, + container: o.container, popup: { type: "bi.multi_select_popup_view", ref: function () { diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index b3a4382d7..9f99f9769 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -121,6 +121,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this.combo = BI.createWidget({ type: "bi.combo", toggle: false, + container: o.container, el: this.trigger, adjustLength: 1, popup: { diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js index f44c6701d..31c8b15e9 100644 --- a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js +++ b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js @@ -124,6 +124,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, { this.combo = BI.createWidget({ type: "bi.combo", toggle: false, + container: o.container, el: this.trigger, adjustLength: 1, popup: {