提交 f6924a4a 编写于 作者: C campaign

by zhanyi

上级 2e835e08
......@@ -44,7 +44,10 @@ var filterNode = UE.filterNode = function () {
});
tmpVal = tmpCssStyle.join(';')
}
tmpAttrs[a] = tmpVal;
if(tmpVal !== ""){
tmpAttrs[a] = tmpVal;
}
}
node.attrs = tmpAttrs;
}
......@@ -80,6 +83,15 @@ var filterNode = UE.filterNode = function () {
}
return function(root,rules){
if(utils.isEmptyObject(rules)){
return root;
}
var val;
if(val = rules['-']){
utils.each(val.split(' '),function(k){
rules[k] = '-'
})
}
for(var i= 0,ci;ci=root.children[i];){
filterNode(ci,rules);
if(ci.parentNode){
......
......@@ -229,34 +229,31 @@
},
insertBefore:function (target, source) {
if (this.children) {
if(target.parentNode){
target.parentNode.removeChild(target);
}
for (var i = 0, ci; ci = this.children[i]; i++) {
if (ci === target) {
this.children.splice(i, 1);
i--;
}
if (ci === source) {
this.children.splice(i, 0, target);
target.parentNode = this;
i++;
return target;
}
}
return target;
}
},
insertAfter:function (target, source) {
if (this.children) {
if(target.parentNode){
target.parentNode.removeChild(target);
}
for (var i = 0, ci; ci = this.children[i]; i++) {
if (ci === target) {
this.children.splice(i, 1);
i--;
}
if (ci === source) {
this.children.splice(i + 1, 1, target);
this.children.splice(i + 1, 0, target);
target.parentNode = this;
i = i + 2;
return target;
}
return target;
}
}
},
......@@ -341,7 +338,7 @@
}
var reg = new RegExp(name + ':([^;]+)');
var match = cssStyle.match(reg);
if (match[0]) {
if (match && match[0]) {
return match[1]
}
return '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册