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

Feat/design ui useable #38

Merged
merged 37 commits into from
Jun 20, 2018
Merged

Feat/design ui useable #38

merged 37 commits into from
Jun 20, 2018

Conversation

jinwoo-kim-nhn
Copy link
Contributor

@jinwoo-kim-nhn jinwoo-kim-nhn commented Jun 18, 2018

work

  • includeUI가 true일때 text 모드의 fabric text 모드를 IText 로 변경함.
  • icon메뉴에서 아이콘 추가시 dragable로 icon이 추가되도록 변경
  • 복수 선택 object들을 일괄 삭제할수 있도록 변경
  • 복수 선택 시 selection style변경
  • shape, draw 메뉴에서 도형이 선택되어지지 않았을때는 대기모드 상태가 되도록 변경
  • text메뉴에서 텍스트가 추가된 후 canvas를 클릭하면 대기 모드로 변경되고 text 메뉴도 닫히도록 변경
  • 테마에 svg 메뉴 Icon 의 사이즈 조정 옵션 추가.
  • 미흡한 테스트케이스 보충.

examples

@@ -38,6 +39,8 @@ class Icon extends Component {
* @type {Object}
*/
this._pathMap = pathMap;
// this.useDragAddIcon = graphics.useDragAddIcon;
Copy link
Member

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,
Copy link
Member

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()', () => {
Copy link
Member

Choose a reason for hiding this comment

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

내용이 없습니다.

.{prefix}-main.tui-image-editor-menu-draw,
.{prefix}-main.tui-image-editor-menu-filter
.{prefix}-submenu
Copy link
Member

Choose a reason for hiding this comment

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

프리픽스 매번 붙여줄 필요 없이 아래 함수 쓰면 될 것 같아요.

+prefix-classes(prefix)

* @ignore
*/
class Graphics {
constructor(element, cssMaxWidth, cssMaxHeight) {
constructor(element, {cssMaxWidth, cssMaxHeight, useItext = false, useDragAddIcon = false} = {}) {
Copy link
Member

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
} = {}) {
  // ...
}

@@ -68,6 +70,18 @@ class Graphics {
*/
this.cssMaxHeight = cssMaxHeight || DEFAULT_CSS_MAX_HEIGHT;

/**
* Use Itext mode for text component
* @type {number}
Copy link
Member

Choose a reason for hiding this comment

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

타입 불린으로 수정이요~


/**
* Use add drag icon mode for icon component
* @type {number}
Copy link
Member

Choose a reason for hiding this comment

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

이 값도 불린이겠네요.

* @private
*/
_onSelectionCreated(fEvent) {
const {target} = fEvent;
Copy link
Member

Choose a reason for hiding this comment

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

디스트럭처링해서 변수 할당까지 할 필요는 없어보여요~

obj.hoverCursor = 'move';
} else {
obj.hoverCursor = 'crosshair';
}
Copy link
Member

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';

* @private
*/
_removeObjectStream(targetObjects) {
if (targetObjects.length === 0) {
Copy link
Member

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) {
Copy link
Member

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');
Copy link
Member

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;
Copy link
Member

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() {}
Copy link
Member

Choose a reason for hiding this comment

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

changeStandbyMode 이 메서드랑 요건 추상 메서드인가요??

@seonim-ryu
Copy link
Member

[6/19] 리뷰 완료하였습니다. 고생 많으셨어요~

@jinwoo-kim-nhn jinwoo-kim-nhn merged commit be35abf into feat/design Jun 20, 2018
@jinwoo-kim-nhn jinwoo-kim-nhn deleted the feat/design-ui-useable branch July 16, 2018 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants