Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-9135:[ALW] grayed out effect issue #1384

Open
wants to merge 1 commit into
base: 4.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/bundle/ui-dev/src/modules/common/popup/popup.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const Popup = ({
});
const closeBtnLabel = Translator.trans(/*@Desc("Close")*/ 'popup.close.label', {}, 'ibexa_universal_discovery_widget');
const hidePopup = () => {
modalRef.current.removeEventListener('hidden.bs.modal', onClose);
bootstrap.Modal.getOrCreateInstance(modalRef.current).hide();
rootDOMElement.classList.remove(CLASS_MODAL_OPEN, CLASS_NON_SCROLLABLE);
};
Expand All @@ -79,10 +80,13 @@ const Popup = ({

bootstrapModal.show();
};
const handleOnClick = (event, onClick) => {
const handleOnClick = (event, onClick, preventClose) => {
modalRef.current.removeEventListener('hidden.bs.modal', onClose);
hidePopup();
onClick(event);
if (!preventClose) {
hidePopup();
}

onClick(event, hidePopup);
};
const renderCloseBtn = () => {
if (noCloseBtn) {
Expand Down Expand Up @@ -119,12 +123,12 @@ const Popup = ({
)}
<div className="modal-body c-popup__body">{children}</div>
<div className="modal-footer c-popup__footer">
{actionBtnsConfig.map(({ className, onClick, disabled = false, label, ...extraProps }) => (
{actionBtnsConfig.map(({ className, onClick, disabled = false, preventClose = false, label, ...extraProps }) => (
<button
key={label}
type="button"
className={`btn ibexa-btn ${className}`}
onClick={onClick ? (event) => handleOnClick(event, onClick) : hidePopup}
onClick={onClick ? (event) => handleOnClick(event, onClick, preventClose) : hidePopup}
disabled={disabled}
{...extraProps}
>
Expand All @@ -145,6 +149,7 @@ Popup.propTypes = {
onClick: PropTypes.func,
disabled: PropTypes.bool,
className: PropTypes.string,
preventClose: PropTypes.bool,
}),
).isRequired,
children: PropTypes.node.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/ui-dev/src/modules/common/spinner/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createCssClassNames } from '@ibexa-admin-ui/src/bundle/ui-dev/src/modul
export const SIZES = {
SMALL: 'small',
MEDIUM: 'medium',
SIZES: 'large',
LARGE: 'large',
};

const Spinner = ({ size }) => {
Expand Down
Loading