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

[3단계 - 행운의 로또 미션] 지그(송지은) 미션 제출합니다. #64

Merged
merged 36 commits into from
Mar 2, 2021
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6385769
[1단계 - 행운의 로또 미션] 티케(조은현) 미션 제출합니다 (#26)
devhyun637 Feb 20, 2021
1be66e6
Merge branch 'zigsong' of https://github.com/woowacourse/javascript-l…
zigsong Feb 28, 2021
71cb30a
docs: make step3 todos
zigsong Feb 25, 2021
f731765
test: show purchase-type select butons
zigsong Feb 25, 2021
398fb2d
feat: show purchase-type select butons
zigsong Feb 25, 2021
cdca062
refactor: rename lotto-input-nums to lotto-winning-nums
zigsong Feb 25, 2021
8daa689
test: switch purchase-type button color
zigsong Feb 25, 2021
45e24fe
feat: switch purchase-type button
zigsong Feb 25, 2021
472a630
test: show manual input form when choose manual purchase
zigsong Feb 26, 2021
e3920bd
refactor: rename dom to selector
zigsong Feb 26, 2021
08ca044
feat: show manual input form when choose manual purchase
zigsong Feb 26, 2021
e1fef16
test: alert when type duplicate numbers in manual input
zigsong Feb 26, 2021
7823ca7
feat: alert when type duplicate numbers in manual input
zigsong Feb 26, 2021
9607d94
test: show confirmed lotto ticket if typed manul numbers correctly
zigsong Feb 27, 2021
da9f3d5
feat: create & show confirmed lotto ticket if typed manul numbers cor…
zigsong Feb 27, 2021
f311083
test: show confirm alert when manual input count is lesser than price
zigsong Feb 27, 2021
b928fd3
feat: show confirm alert when manual input count is lesser than price
zigsong Feb 27, 2021
9b04090
test: process auto purchase when agree to auto purchase confirm
zigsong Feb 27, 2021
b1238d5
feat: process auto purchase when agree to auto purchase confirm
zigsong Feb 27, 2021
64aa134
fix: remove wrong classname and unnecessary index
zigsong Feb 27, 2021
8728c0f
feat: process manual purchase when typed all manual inputs
zigsong Feb 27, 2021
dd3f2ab
fix: fix bugs when switching between auto/manual purchase
zigsong Feb 28, 2021
6329e9d
fix: resolve conflicts with step2 merge commit
zigsong Feb 28, 2021
cecda97
refactor: update getRandomNumber logic
zigsong Feb 28, 2021
d6a3dc2
refactor: remove unnecessary classnames & add lotto number constant
zigsong Feb 28, 2021
910947d
refactor: typos in cypress
zigsong Feb 28, 2021
60f0ba5
feat: add auto-convert caption in manual input view
zigsong Feb 28, 2021
62aaf02
feat: move focus to next input in manual input view
zigsong Feb 28, 2021
3682f7e
refactor:
zigsong Mar 1, 2021
f7858e1
refactor:
zigsong Mar 1, 2021
964f5e6
fix: fix binding events bug on manualInputView
zigsong Mar 1, 2021
18d57c1
refactor: update array loop logic in manualInputView
zigsong Mar 1, 2021
b6db430
refactor: separate method checking if last number input (prevent movi…
zigsong Mar 1, 2021
8afe5e5
refactor: update showAllConfirmButton logic
zigsong Mar 1, 2021
f98aa76
refactor:
zigsong Mar 1, 2021
043299b
fix: reset to autoPurchase when click restart in manual purchase step
zigsong Mar 1, 2021
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
55 changes: 27 additions & 28 deletions src/js/views/ManualInputView.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,39 @@ export default class ManualInputView extends View {
}

createManualLottos() {
const lottoTicekts = [...Array(this.count)]
.map(
(_, idx) => `
<li id="manual-wrapper-${idx}" class="mx-1 my-2 text-4xl manual-wrapper">
<form class="d-flex items-center justify-between manual-input-form">
<span class="lotto-icon">🎟️ </span>
${this.createManualInput()}
<button type="submit" class="btn btn-cyan btn-small manual-input-btn">확정</button>
</form>
</li>
`
)
.join('');
// const lottoTickets = Array.from({length: this.count}, (_, idx) => `<li>....</li>`).join('')
Copy link
Author

Choose a reason for hiding this comment

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

실수로 올라갔네요 😂 다음 커밋에서 지웠습니다!


const lottoTicekts = Array.from(
{ length: this.count },
(_, idx) =>
`<li id="manual-wrapper-${idx}" class="mx-1 my-2 text-4xl manual-wrapper">
<form class="d-flex items-center justify-between manual-input-form">
<span class="lotto-icon">🎟️ </span>
${this.createManualInput()}
<button type="submit" class="btn btn-cyan btn-small manual-input-btn">확정</button>
</form>
</li>
`
).join('');
this.$element.innerHTML = lottoTicekts;
$('#input-price-form').insertAdjacentElement('afterend', this.$element);
Copy link
Author

Choose a reason for hiding this comment

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

이제는 자주 사용하게 된 insertAdjacentElement 👍

}

createManualInput() {
return [...Array(LOTTO_NUMBERS.LOTTO_MANUAL_COUNT)]
.map(
(_, i) => `
<input
type="number"
class="manual-number mx-1 text-center"
aria-label="manual-number-${i}"
data-manual-index="${i}"
required
min="1"
max="45"
/>
`
)
.join('');
return Array.from(
{ length: LOTTO_NUMBERS.LOTTO_MANUAL_COUNT },
(_, i) =>
`<input
type="number"
class="manual-number mx-1 text-center"
aria-label="manual-number-${i}"
data-manual-index="${i}"
required
min="1"
max="45"
/>
`
).join('');
}

bindManualInputEvent() {
Expand Down