Skip to content

Commit

Permalink
카테고리 선택이 자연스럽게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
usbsync committed Apr 23, 2024
1 parent f49146a commit f2382e0
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions src/playground/block_menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,18 +612,11 @@ class BlockMenu extends ModelClass<Schema> {
toggleBlockMenu() {
const board = this.workspace.board;
const boardView = board.view;
const elem = this._categoryElems[this.lastSelector];
const className = 'entrySelectedCategory';
const className2 = 'entryUnSelectedCategory';

if (!boardView.hasClass('folding')) {
boardView.addClass('folding');
Entry.playground.resizeHandle_.addClass('folding');
Entry.playground.resizeHandle_.removeClass('unfolding');
if (elem) {
elem.removeClass(className);
elem.addClass(className2);
}
Entry.playground.hideTabs();
this.visible = false;
} else {
Expand All @@ -642,13 +635,6 @@ class BlockMenu extends ModelClass<Schema> {
Entry.windowResized.notify();
});

if (this.visible) {
if (elem) {
elem.removeClass(className2);
elem.addClass(className);
}
}

this.align();
}

Expand Down Expand Up @@ -694,12 +680,15 @@ class BlockMenu extends ModelClass<Schema> {
oldView.addClass(className2);
}

if (this.visible) {
this._selectedCategoryView = elem;
if (elem) {
elem.removeClass(className2);
elem.addClass(className);
}
if (elem === oldView && !(doNotFold || !this.hasCategory())) {
elem.removeClass(className);
elem.addClass(className2);
}

this._selectedCategoryView = elem;
if (elem) {
elem.removeClass(className2);
elem.addClass(className);
}

doNotAlign !== true && this.align();
Expand Down

0 comments on commit f2382e0

Please sign in to comment.