Skip to content

Commit

Permalink
修复对嵌套的span标签设置样式时,被嵌套的标签不能正确设置上给定的样式
Browse files Browse the repository at this point in the history
  • Loading branch information
campaign committed Nov 13, 2014
1 parent 67b0ae8 commit 311cd80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions _src/core/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,12 @@
domUtils.setAttributes(elm, attrs);
}
elm.appendChild(frag);
//针对嵌套span的全局样式指定,做容错处理
if(elm.tagName == 'SPAN' && attrs && attrs.style){
utils.each(elm.getElementsByTagName('span'),function(s){
s.style.cssText = s.style.cssText + ';' + attrs.style;
})
}
range.insertNode(list ? top : elm);
//处理下滑线在a上的情况
var aNode;
Expand Down
3 changes: 1 addition & 2 deletions _src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ var baidu = window.baidu || {};

window.baidu = baidu;

window.UE = baidu.editor = window.UE || {
window.UE = baidu.editor = {
plugins:{},
commands:{},
instants:{},
I18N:{},
_customizeUI:{},
version:'1.5.0'
};

var dom = UE.dom = {};

0 comments on commit 311cd80

Please sign in to comment.