kopia lustrzana https://github.com/c9/core
Updated the forms.update() function to be generic
rodzic
0dafa98032
commit
784b3edaec
|
@ -481,14 +481,21 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ("value" in item)
|
|
||||||
el.lastChild.setAttribute('value', item.value);
|
|
||||||
if ("onclick" in item)
|
if ("onclick" in item)
|
||||||
el.lastChild.onclick = item.onclick;
|
el.lastChild.onclick = item.onclick;
|
||||||
if ("visible" in item)
|
|
||||||
el.lastChild.setAttribute("visible", item.visible)
|
var ignoreList = ["onclick"];
|
||||||
if ("zindex" in item)
|
|
||||||
el.lastChild.setAttribute("zindex", item.zindex)
|
Object.keys(item).forEach(function(key) {
|
||||||
|
if (ignoreList.indexOf(key) > -1) return;
|
||||||
|
|
||||||
|
var attributeExists = el.lastChild.attributes.some(function(attribute) {
|
||||||
|
return (attribute.name === key)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (attributeExists)
|
||||||
|
el.lastChild.setAttribute(key, item[key]);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Ładowanie…
Reference in New Issue