submit button de-id-d
This commit is contained in:
parent
14ee0b4127
commit
67c33aee3e
2 changed files with 13 additions and 16 deletions
|
|
@ -377,7 +377,7 @@
|
||||||
width: 2em;
|
width: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#submit-button-area {
|
.submit-button-area {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@ const PopupNotification = require('../components/PopupNotification');
|
||||||
|
|
||||||
const offerService = require('../services/offerService');
|
const offerService = require('../services/offerService');
|
||||||
|
|
||||||
class CreateOfferModal {
|
class CreateOfferModal { // Stop relying on IDs
|
||||||
// Actual creation logic to be provided by a service
|
|
||||||
// Stop relying on IDs
|
|
||||||
constructor({ parentElement, onCreationCallback, offerService }) {
|
constructor({ parentElement, onCreationCallback, offerService }) {
|
||||||
this.element = null;
|
this.element = null;
|
||||||
this.parentElement = parentElement;
|
this.parentElement = parentElement;
|
||||||
|
|
@ -98,7 +96,17 @@ class CreateOfferModal {
|
||||||
});
|
});
|
||||||
|
|
||||||
const submitButtonArea = document.createElement('div');
|
const submitButtonArea = document.createElement('div');
|
||||||
submitButtonArea.id = 'submit-button-area';
|
submitButtonArea.classList.add('submit-button-area')
|
||||||
|
this.publishOfferButton = new PublishOfferButton({
|
||||||
|
parentElement: submitButtonArea,
|
||||||
|
id: 'button-submit-offer',
|
||||||
|
onClickCallback: async () => {
|
||||||
|
await this.createOffer();
|
||||||
|
await this.onCreationCallback();
|
||||||
|
await this.toggleOfferCreatedAlert();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.publishOfferButton.render();
|
||||||
|
|
||||||
const closeButtonArea = document.createElement('div');
|
const closeButtonArea = document.createElement('div');
|
||||||
closeButtonArea.id = 'close-offer-controls-area';
|
closeButtonArea.id = 'close-offer-controls-area';
|
||||||
|
|
@ -122,17 +130,6 @@ class CreateOfferModal {
|
||||||
return Math.floor(Math.random() * (95000 - 70000 + 1) + 70000);
|
return Math.floor(Math.random() * (95000 - 70000 + 1) + 70000);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.publishOfferButton = new PublishOfferButton({
|
|
||||||
parentElement: document.getElementById('submit-button-area'),
|
|
||||||
id: 'button-submit-offer',
|
|
||||||
onClickCallback: async () => {
|
|
||||||
await this.createOffer();
|
|
||||||
await this.onCreationCallback();
|
|
||||||
await this.toggleOfferCreatedAlert();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
this.publishOfferButton.render();
|
|
||||||
|
|
||||||
this.buyOrSellButtonGroup = new BuyOrSellButtonGroup({
|
this.buyOrSellButtonGroup = new BuyOrSellButtonGroup({
|
||||||
parentElement: document.getElementById('buy-or-sell-area'),
|
parentElement: document.getElementById('buy-or-sell-area'),
|
||||||
id: 'button-group-buy-or-sell',
|
id: 'button-group-buy-or-sell',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue