소스 검색

fix: ensure `Page.add_dropdown_item` returns link even if it already exists (#13420)

version-14
Sagar Vora 4 년 전
committed by GitHub
부모
커밋
02765c98c9
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. +5
    -3
      frappe/public/js/frappe/ui/page.js

+ 5
- 3
frappe/public/js/frappe/ui/page.js 파일 보기

@@ -409,6 +409,9 @@ frappe.ui.Page = class Page {
parent.parent().removeClass("hide");
}

let $link = this.is_in_group_button_dropdown(parent, 'li > a.grey-link', label);
if ($link) return $link;

let $li;
let $icon = ``;

@@ -440,9 +443,8 @@ frappe.ui.Page = class Page {
</li>
`);
}
var $link = $li.find("a").on("click", click);

if (this.is_in_group_button_dropdown(parent, 'li > a.grey-link', label)) return;
$link = $li.find("a").on("click", click);

if (standard) {
$li.appendTo(parent);
@@ -508,7 +510,7 @@ frappe.ui.Page = class Page {
let item = $(this).html();
return $(item).attr('data-label') === label;
});
return result.length > 0;
return result.length > 0 && result;
}

clear_btn_group(parent) {


불러오는 중...
취소
저장