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

fix: Issues with Modal and Image Cropper position #5367

Merged
Show file tree
Hide file tree
Changes from 4 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
11 changes: 6 additions & 5 deletions app/components/modals/modal-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { isTesting } from 'open-event-frontend/utils/testing';

export default UiModal.extend({
tagName : 'div',
classNames : ['centered-modal'],
classNameBindings : ['isFullScreen:fullscreen', 'isSmall:small', 'isLarge:large'],

openObserver: observer('isOpen', function() {
const $element = $(this.element);
if (this.isOpen) {
$element.modal('show');
$element.modal({...this.defaultOptions}).modal('show');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$element.modal({...this.defaultOptions}).modal('show');
$element.modal(this.defaultOptions).modal('show');

} else {
$element.modal('hide');
}
Expand Down Expand Up @@ -46,8 +47,8 @@ export default UiModal.extend({
willInitSemantic(settings) {
this._super(...arguments);

const defaultOptions = {
detachable : false,
this.defaultOptions = {
centered : false,
duration : isTesting ? 0 : 200,
dimmerSettings : {
dimmerName : `${this.elementId}-modal-dimmer`,
Expand Down Expand Up @@ -85,13 +86,13 @@ export default UiModal.extend({
}
};

const options = this.options ? merge(defaultOptions, this.options) : defaultOptions;
const options = this.options ? merge(this.defaultOptions, this.options) : this.defaultOptions;
assign(settings, options);
},

didInitSemantic() {
if (this.isOpen) {
$(this.element).modal('show');
$(this.element).modal({...this.defaultOptions}).modal('show');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$(this.element).modal({...this.defaultOptions}).modal('show');
$(this.element).modal(this.defaultOptions).modal('show');

}
}
});
3 changes: 0 additions & 3 deletions app/components/modals/tax-info-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { orderBy } from 'lodash-es';

export default ModalBase.extend(FormMixin, {
isSmall : false,
options : {
closable: false
},

autoScrollToErrors : true,
isTaxIncludedInPrice : 'include',
Expand Down
5 changes: 5 additions & 0 deletions app/styles/partials/overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,8 @@ body.dimmable.undetached.dimmed {
}
}
}

.centered-modal {
margin-left: auto !important;
margin-top: auto !important;
}
1 change: 1 addition & 0 deletions app/templates/components/modals/tax-info-modal.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<i class="black close icon"></i>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a closable icon in the modal I believe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal not present earlier. please see #4505

<div class="header">
{{t 'Add tax information'}}
</div>
Expand Down