Skip to content

Commit

Permalink
fix: Issues with Modal and Image Cropper position (#5367)
Browse files Browse the repository at this point in the history
Co-authored-by: Areeb Jamal <jamal.areeb@gmail.com>
  • Loading branch information
sachinchauhan2889 and iamareebjamal committed Oct 24, 2020
1 parent 03422cf commit 7971c4a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
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');
} 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');
}
}
});
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
6 changes: 6 additions & 0 deletions app/styles/partials/overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ body.dimmable.undetached.dimmed {
}
}
}

.centered-modal {
margin-left: auto !important;
margin-top: auto !important;
left: 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>
<div class="header">
{{t 'Add tax information'}}
</div>
Expand Down

1 comment on commit 7971c4a

@vercel
Copy link

@vercel vercel bot commented on 7971c4a Oct 24, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.