diff --git a/bi/base.js b/bi/base.js index c3981ad98e..7e899402e5 100644 --- a/bi/base.js +++ b/bi/base.js @@ -16200,6 +16200,25 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { vgap: 3 }) }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } }); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 diff --git a/demo/js/base/editor/demo.rich_editor.js b/demo/js/base/editor/demo.rich_editor.js index 1f66c4fb67..862ee7b752 100644 --- a/demo/js/base/editor/demo.rich_editor.js +++ b/demo/js/base/editor/demo.rich_editor.js @@ -13,7 +13,7 @@ Demo.RichEditor = BI.inherit(BI.Widget, { type: "bi.vertical", element: this, hgap: 30, - vgap: 20, + vgap: 50, items: [this.editor] }) }, diff --git a/dist/base.js b/dist/base.js index 51d3a8f332..4edce5990c 100644 --- a/dist/base.js +++ b/dist/base.js @@ -16200,6 +16200,25 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { vgap: 3 }) }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } }); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 diff --git a/dist/bundle.js b/dist/bundle.js index ed49930645..1c59820847 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -45006,6 +45006,25 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { vgap: 3 }) }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } }); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 diff --git a/dist/demo.js b/dist/demo.js index 720ed67b74..545f614a2f 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -824,7 +824,7 @@ BI.shortcut("demo.multifile_editor", Demo.CodeEditor);Demo.RichEditor = BI.inher type: "bi.vertical", element: this, hgap: 30, - vgap: 20, + vgap: 50, items: [this.editor] }) }, diff --git a/dist/resource.css b/dist/resource.css index 9426ebd30c..35eab79e17 100644 --- a/dist/resource.css +++ b/dist/resource.css @@ -138,6 +138,10 @@ textarea::-webkit-scrollbar-thumb:hover { /* iOS 4.1- */ } +@font-face { + font-family: 'bi'; + src: url('font/iconfont.eot') /* IE6-IE8 */; +} .b-font { font-family: "bi"; font-style: normal; diff --git a/src/base/richeditor/bar/texttoolbar.js b/src/base/richeditor/bar/texttoolbar.js index 2b0379f583..0525bef36b 100644 --- a/src/base/richeditor/bar/texttoolbar.js +++ b/src/base/richeditor/bar/texttoolbar.js @@ -39,5 +39,24 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { vgap: 3 }) }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } }); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar); \ No newline at end of file diff --git a/src/css/resource/font.css b/src/css/resource/font.css index 78c39f1a09..40413daa9b 100644 --- a/src/css/resource/font.css +++ b/src/css/resource/font.css @@ -4,6 +4,10 @@ /* iOS 4.1- */ } +@font-face { + font-family: 'bi'; + src: url('font/iconfont.eot') /* IE6-IE8 */; +} .b-font { font-family: "bi"; font-style: normal; diff --git a/src/less/resource/font.less b/src/less/resource/font.less index 5c901c7051..c8c928b4fa 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -7,6 +7,13 @@ src: url('@{webUrl}font/iconfont.eot'), /* IE6-IE8 */ url('@{webUrl}font/iconfont.woff') format('woff'), /* chrome、firefox */ url('@{webUrl}font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{webUrl}font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ } +html.ie9below { + @font-face { + font-family: 'bi'; + src: url('@{webUrl}font/iconfont.eot') /* IE6-IE8 */ + } +} + .b-font { font-family: "bi"; font-style: normal;