Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 5c208b9

Browse files
Hamza/79326/fix: view button disabling on Portfolio Page (#7329)
* fix: view button disabling on Portfolio Page * Merge branch 'master' of github.com:binary-com/binary-static into hamza/79326/View_button_from_portfolio_page_is_getting_disabled * fix: empty --------- Co-authored-by: Matin shafiei <matin@deriv.com>
1 parent 1e6c0cb commit 5c208b9

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/javascript/app/pages/user/view_popup/view_popup.ui.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,33 @@ const ViewPopupUI = (() => {
7272
}
7373
};
7474

75+
const enableButton = (button) => {
76+
button.removeAttr('disabled');
77+
button.fadeTo(0, 1);
78+
};
79+
80+
const enableContractViewButton = () => {
81+
$('.open_contract_details[disabled]').each(function () {
82+
enableButton($(this));
83+
});
84+
};
85+
7586
const closeContainer = () => {
7687
if ($container) {
7788
$container.hide().remove();
7889
$('.popup_page_overlay').hide().remove();
7990
$container = null;
91+
enableContractViewButton();
8092
}
8193
$('html').removeClass('no-scroll');
8294
};
8395

8496
const disableButton = (button) => {
85-
$('.open_contract_details[disabled]').each(function () {
86-
enableButton($(this));
87-
});
97+
enableContractViewButton();
8898
button.attr('disabled', 'disabled');
8999
button.fadeTo(0, 0.5);
90100
};
91101

92-
const enableButton = (button) => {
93-
button.removeAttr('disabled');
94-
button.fadeTo(0, 1);
95-
};
96-
97102
const showInpagePopup = (data, containerClass, dragHandle) => {
98103
const con = container(true);
99104
if (containerClass) {

0 commit comments

Comments
 (0)