Skip to content
This repository was archived by the owner on Oct 5, 2019. It is now read-only.

Commit e03dff3

Browse files
authored
Merge pull request #203 from yuta0801/stock-num
feat: ストックに合わせてストック数を加減させる
2 parents e96bf25 + c0deca9 commit e03dff3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/content_scripts/article/article-dom-handler.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ export default class ArticleDomHandler {
195195
div.textContent = count;
196196

197197
parentElement.insertBefore(div, this.getStockButtons()[0]);
198+
199+
this.getStockButtons()[0].addEventListener('click', () => {
200+
if (div.textContent === '100+') return;
201+
div.textContent = Number(div.textContent) + (this.isStocked() ? -1 : 1);
202+
});
198203
}
199204

200205
isLiked() {

0 commit comments

Comments
 (0)