-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Do not fire "changeShow" event when ColorPicker's color not changed (fix #131) #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฆฌ๋ทฐ ์๋ฃํ์ต๋๋ค. ์๊ณ ํ์ จ์ต๋๋ค.
* @private | ||
*/ | ||
_isPaletteButton(target) { | ||
return target.className === 'tui-colorpicker-palette-button'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ์๋ฆฌ๋จผํธ์ ํด๋์ค๋ ํ ๊ฐ์ธ ๊ฒ์ด ๋ณด์ฅ์ด ๋๋๊ฑฐ์์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classList ์จ๋ ๋์ง ์์๊น์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dongsik-yoo ๋ค. color-picker์ prefix๋ฅผ ui ๋ด๋ถ์์ ๋ง๋ค๊ณ ์๊ณ , ์ต์
์ผ๋ก ๋ณ๊ฒฝํ ์๋ ์์ต๋๋ค. ๊ทธ๋์ ํ์ฌ ์ ์ฉ๋ ํด๋์ค๋ช
์ ์ง์ ๋น๊ตํ๊ณ ์์ต๋๋ค.
@jinwoo-kim-nhn className
์ด ๋ ๋์ ๋ธ๋ผ์ฐ์ ์ง์์ํด์ ์ฌ์ฉํ์ต๋๋ค. ๋จ์ผ ํด๋์ค์ด๊ธฐ๋ ํ๊ณ ์~
* @returns {boolean} | ||
* @private | ||
*/ | ||
_isElementInColorPickerControl(element) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ๊ธฐ๋ฅ์ด ๊ฐ๋จํ๊ธด ํ์ง๋ง ์ฌ๋ฌ ๊ตฐ๋ฐ์ ์ธ ๊ฐ๋ฅ์ฑ์ด ๋ํํ ํจ์๋ก ๋ณด์ฌ์. parents ์์ ํน์ ์๋ฆฌ๋จผํธ๋ฅผ ์ฐพ๋ ๊ธฐ๋ฅ์ผ๋ก ์ ํธ๋ก ๋ง๋ค๋ฉด ์ด๋จ๊น ํฉ๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค, ๊ทธ๋์ ๋ถ๋ฆฌ๋ฅผ ๊ณ ๋ คํด๋ดค์ง๋ง ์์ง์ ์ฌ๊ธฐ ํ๊ณณ์์๋ง ์ฌ์ฉํ๊ณ ์๊ณ , ๋ฏธ๋ฆฌ ๋ถ๋ฆฌ ํด๋์ด๋ ์์น๋ฅผ ์ด๋์ ๋์ง ์ ๋งคํ ๊ฒฝ์ฐ๊ฐ ์๊ธฐ๋๋ผ๊ณ ์.
์ถํ ํ์ํ ๊ณณ์ด ์๊ธด๋ค๋ฉด ๊ทธ๋ ๋ถ๋ฆฌํ๊ณ ์ ํฉ๋๋ค :)
|
||
if (!isInPickerControl || (isInPickerControl && this._isPaletteButton(target))) { | ||
this._show = !this._show; | ||
this.pickerControl.style.display = this._show ? 'block' : 'none'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
colorpickerElement
์ ๋ถ๋ชจ๊ฐ pickerControl
์์?
ํด๋ฆญํ ์๋ฆฌ๋จผํธ๋ง ๋ณด์ง ์๊ณ ๋ถ๋ชจ๊น์ง ๋ณด๋๋ก ์ฒ๋ฆฌํ๊ฑฐ์ฃ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dongsik-yoo ์๋จ colorpickerElement
๊ฐ pickerControl
์ ํฌํจํ๊ณ ์์ต๋๋ค.
๊ทธ๋์ pickerControl
์ ํด๋ฆญ๋ํ ์ฌ๊ธฐ์ ์ฒ๋ฆฌํ๊ณ ์์ต๋๋ค.
pickerControl
์ด ํด๋ฆญ๋์ง ์์ ๊ฒฝ์ฐ๋colorpickerElement
๊ฐ ํด๋ฆญ๋์์ผ๋ ColorPicker๋ฅผ ๋ ธ์ถ ์ํ๋ฅผ ํ ๊ธํ๊ณ ,pickerControl
์๋ฆฌ๋จผํธ๊ฐ ํด๋ฆญ๋์์ง๋ง Palette button์ด ํด๋ฆญ๋์ง ์์์๋๋ ์์ง ์ ํ์ค์ด๋ฏ๋ก ๋ ์ด์ด๋ฅผ ๋ซ์ง ์๋๋ก ์์ ํ์ต๋๋ค.
๋ฆฌ๋ทฐ ์๋ฃํ์ต๋๋ค. ์๊ณ ํ์ จ์ด์ |
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
Change show state when color changes & initial color-picker opening.
Thank you for your contribution to TOAST UI product. ๐ ๐ โจ