mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 19:12:40 +08:00
7861f01ebc
* optimize edit asset undo * optimize multiple-select assets editing * optimize editing assets * optimize assets editing * optimize asset editing on readonly state * asset.js contentRender panels use Promise.all * remove material header hack action
20 lines
495 B
JavaScript
20 lines
495 B
JavaScript
exports.updateElementReadonly = function(element, readonly) {
|
|
if (readonly === undefined) {
|
|
readonly = this.asset.readonly;
|
|
}
|
|
|
|
if (readonly) {
|
|
element.setAttribute('disabled', true);
|
|
} else {
|
|
element.removeAttribute('disabled');
|
|
}
|
|
};
|
|
|
|
exports.updateElementInvalid = function(element, prop) {
|
|
const invalid = this.metaList.some((meta) => {
|
|
return meta.userData[prop] !== this.meta.userData[prop];
|
|
});
|
|
|
|
element.invalid = invalid;
|
|
};
|