-
Notifications
You must be signed in to change notification settings - Fork 21
fix: slider works properly when the size changed #68
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
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.
리뷰 완료합니다.
src/js/slider.js
Outdated
var sliderRects = this.sliderSvgElement.getClientRects()[0]; | ||
|
||
if (sliderRects) { | ||
COLORSLIDER_POS_LIMIT_RANGE[1] = sliderRects.height - 10; |
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.
상수 값을 바꾸는 것보단 min
, max
계산 시 처리하는게 나을 것 같아요.
src/js/slider.js
Outdated
@@ -170,6 +172,11 @@ Slider.prototype.render = function(colorStr) { | |||
Slider.prototype._moveColorSliderHandle = function(newLeft, newTop, silent) { |
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.
지금 마우스 움직일 때마다 getClientRects
가 호출되는데 클릭 시작 시 혹은 드래그 시작 시에 1번만 호출되야할 것 같아요.
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.
리뷰 완료합니다. 이쪽 프로젝트는 잘 몰라도 의도는 잘 보이네요.
src/js/slider.js
Outdated
var sliderRects = this.sliderSvgElement.getClientRects()[0]; | ||
|
||
if (sliderRects) { | ||
COLORSLIDER_POS_LIMIT_RANGE[1] = sliderRects.height - 10; |
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.
리뷰 완료합니다.
src/js/slider.js
Outdated
@@ -170,6 +172,11 @@ Slider.prototype.render = function(colorStr) { | |||
Slider.prototype._moveColorSliderHandle = function(newLeft, newTop, silent) { |
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.
이름은 슬라이더가 움직일 때마다 호출되는 함수 같은데 전체 코드상 맞는지 확인 부탁드려요.
chore: change constants to variables chore: set sliders maximum pos when drag starts
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.
LGTM
그런데 이제와서 깨달은거지만, 컬러피커가 IE8+ 지원이라고 써있는데 querySelector를 쓰고 있네요. 이미 쓰고있었던거니까 IE8 지원은 안되고있는거라고 봐야할지도...
@adhrinae |
@jajugoguma |
@adhrinae |
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
As-Is

To-Be

Thank you for your contribution to TOAST UI product. 🎉 😘 ✨