Procházet zdrojové kódy

Merge pull request #14392 from shariquerik/list-check-all-fix

fix: Update check all checkbox based on checked rows in List View
version-14
mergify[bot] před 3 roky
committed by GitHub
rodič
revize
af54411e01
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
1 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. +14
    -0
      frappe/public/js/frappe/list/list_view.js

+ 14
- 0
frappe/public/js/frappe/list/list_view.js Zobrazit soubor

@@ -302,9 +302,20 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
refresh(refresh_header=false) {
super.refresh().then(() => {
this.render_header(refresh_header);
this.update_checkbox();
});
}

update_checkbox(target) {
let $check_all_checkbox = this.$checkbox_actions.find(".list-check-all");

if ($check_all_checkbox.prop("checked") && target && !target.prop("checked")) {
$check_all_checkbox.prop("checked", false);
}

$check_all_checkbox.prop("checked", this.$checks.length === this.data.length);
}

setup_freeze_area() {
this.$freeze = $(
`<div class="freeze flex justify-center align-center text-muted">${__(
@@ -1253,6 +1264,8 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
}

this.$checkbox_cursor = $target;

this.update_checkbox($target);
});
}

@@ -1398,6 +1411,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
this.$checkbox_actions.show();
this.$list_head_subject.hide();
}
this.update_checkbox();
this.toggle_actions_menu_button(this.$checks.length > 0);
}



Načítá se…
Zrušit
Uložit