perf: avoid layout thrashing in control input toggle
This commit is contained in:
parent
ffd064c858
commit
260abca660
1 changed files with 5 additions and 5 deletions
|
|
@ -26,7 +26,7 @@ frappe.ui.form.ControlInput = class ControlInput extends frappe.ui.form.Control
|
|||
</div>
|
||||
<div class="control-input-wrapper">
|
||||
<div class="control-input"></div>
|
||||
<div class="control-value like-disabled-input" style="display: none;"></div>
|
||||
<div class="control-value like-disabled-input hide"></div>
|
||||
<div class="help-box small text-extra-muted hide"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -115,8 +115,8 @@ frappe.ui.form.ControlInput = class ControlInput extends frappe.ui.form.Control
|
|||
let is_fetch_from_read_only = me.read_only_because_of_fetch_from();
|
||||
|
||||
if (me.can_write() && !is_fetch_from_read_only) {
|
||||
me.disp_area && $(me.disp_area).toggle(false);
|
||||
$(me.input_area).toggle(true);
|
||||
me.disp_area && $(me.disp_area).addClass("hide");
|
||||
$(me.input_area).removeClass("hide");
|
||||
me.$input && me.$input.prop("disabled", false);
|
||||
make_input();
|
||||
update_input();
|
||||
|
|
@ -125,10 +125,10 @@ frappe.ui.form.ControlInput = class ControlInput extends frappe.ui.form.Control
|
|||
make_input();
|
||||
update_input();
|
||||
} else {
|
||||
$(me.input_area).toggle(false);
|
||||
$(me.input_area).addClass("hide");
|
||||
if (me.disp_area) {
|
||||
me.set_disp_area(me.value);
|
||||
$(me.disp_area).toggle(true);
|
||||
$(me.disp_area).removeClass("hide");
|
||||
}
|
||||
}
|
||||
me.$input && me.$input.prop("disabled", true);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue