-
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
Feat/design ui useable #38
Conversation
src/js/component/icon.js
Outdated
@@ -38,6 +39,8 @@ class Icon extends Component { | |||
* @type {Object} | |||
*/ | |||
this._pathMap = pathMap; | |||
// this.useDragAddIcon = graphics.useDragAddIcon; |
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.
불필요한것이 아직 남아있어요.
realTimeEvent: true, | ||
min: 0, | ||
realTimeEvent: false, | ||
min: 2, |
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.
지난번과 비슷한데 상수 빠져있으면 좋겠습니다.
@@ -21,6 +21,13 @@ describe('UI', () => { | |||
}; | |||
ui = new UI(document.createElement('div'), uiOptions, {}); | |||
}); | |||
describe('_changeMenu()', () => { |
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/css/submenu.styl
Outdated
.{prefix}-main.tui-image-editor-menu-draw, | ||
.{prefix}-main.tui-image-editor-menu-filter | ||
.{prefix}-submenu |
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.
프리픽스 매번 붙여줄 필요 없이 아래 함수 쓰면 될 것 같아요.
+prefix-classes(prefix)
src/js/graphics.js
Outdated
* @ignore | ||
*/ | ||
class Graphics { | ||
constructor(element, cssMaxWidth, cssMaxHeight) { | ||
constructor(element, {cssMaxWidth, cssMaxHeight, useItext = false, useDragAddIcon = false} = {}) { |
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.
이렇게 개행하면 더 깔끔하지 않을까요?
constructor(element, {
cssMaxWidth,
cssMaxHeight,
useItext = false,
useDragAddIcon = false
} = {}) {
// ...
}
src/js/graphics.js
Outdated
@@ -68,6 +70,18 @@ class Graphics { | |||
*/ | |||
this.cssMaxHeight = cssMaxHeight || DEFAULT_CSS_MAX_HEIGHT; | |||
|
|||
/** | |||
* Use Itext mode for text component | |||
* @type {number} |
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/graphics.js
Outdated
|
||
/** | ||
* Use add drag icon mode for icon component | ||
* @type {number} |
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/graphics.js
Outdated
* @private | ||
*/ | ||
_onSelectionCreated(fEvent) { | ||
const {target} = fEvent; |
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/graphics.js
Outdated
obj.hoverCursor = 'move'; | ||
} else { | ||
obj.hoverCursor = 'crosshair'; | ||
} |
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.
한줄정리요ㅎㅎ
obj.hoverCursor = selectable ? 'move' : 'crosshair';
src/js/imageEditor.js
Outdated
* @private | ||
*/ | ||
_removeObjectStream(targetObjects) { | ||
if (targetObjects.length === 0) { |
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 (!targetObjects.length) { ... }
src/js/ui.js
Outdated
|
||
this._editorElement.style.top = `${editortop}px`; | ||
this._editorElement.style.left = `${editorleft}px`; | ||
if (menuBarPosition === 'top' && this._selectedElement.offsetWidth < 1235) { |
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.
1235
라...... 이런 값은 매직넘버로 처리하던가 주석 꼭 추가해주세요~
src/js/ui.js
Outdated
if (menuBarPosition === 'top' && this._selectedElement.offsetWidth < 1235) { | ||
this._selectedElement.classList.add('tui-image-editor-top-optimization'); | ||
} else { | ||
this._selectedElement.classList.remove('tui-image-editor-top-optimization'); |
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/ui.js
Outdated
*/ | ||
_setUiSize(uiSize = this.options.uiSize) { | ||
this._selectedElement.style.width = uiSize.width; | ||
this._selectedElement.style.height = uiSize.height; |
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.
스타일 객체는 캐싱해서 사용해주세요~
let style = this._selectedElement.style;
* Interface method whose implementation is optional. | ||
* Executed when the menu starts. | ||
*/ | ||
changeStartMode() {} |
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.
changeStandbyMode
이 메서드랑 요건 추상 메서드인가요??
[6/19] 리뷰 완료하였습니다. 고생 많으셨어요~ |
work
examples