/**
 * Created by rockyl on 2019-11-16.
 */

let targetNode = props.target || target;
if (targetNode) {
	const {scripts} = targetNode;
	const {scriptIndex, scriptName, enabled} = props;
	if (scriptIndex !== undefined) {
		let script = scripts.all[scriptIndex];
		if (script) {
			script.disabled = !enabled;
		}
	} else if (scriptName !== undefined) {
		let scripts = scripts.get(scriptName);
		for(let script of scripts){
			script.disabled = !enabled;
		}
	}
}

next('success', args);
