// Copyright (c) 2024, JINGROW
// For license information, please see license.txt

const call_debug = (frm) => {
	frm.trigger("debug");
};

jingrow.ui.form.on("Permission Inspector", {
	refresh(frm) {
		frm.disable_save();
	},
	pagename: call_debug,
	ref_pagetype(frm) {
		frm.pg.pagename = ""; // Usually pagetype change invalidates pagename
		call_debug(frm);
	},
	user: call_debug,
	permission_type: call_debug,
	debug(frm) {
		if (frm.pg.ref_pagetype && frm.pg.user) {
			frm.call("debug");
		}
	},
});
