Skip to content

Commit

Permalink
JS-5213: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3orblade committed Aug 30, 2024
1 parent fffb3c6 commit 47aa1b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/scss/component/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(79,79,79,0); z-index: 1;
pointer-events: none; border-radius: 6px;
}
.item:hover::before { background: var(--color-shape-highlight-medium); }
.item:hover::before, .item.active::before { background: var(--color-shape-highlight-medium); }
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/ts/component/sidebar/object.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import $ from 'jquery';
import { observer } from 'mobx-react';
import { AutoSizer, CellMeasurer, InfiniteLoader, List, CellMeasurerCache } from 'react-virtualized';
import { Title, Filter, Select, Icon, IconObject, Button, ObjectName, ObjectDescription, ObjectType } from 'Component';
import { I, U, J, S, translate, Storage, sidebar } from 'Lib';
import { I, U, J, S, translate, Storage, sidebar, keyboard } from 'Lib';

interface State {
isLoading: boolean;
Expand Down Expand Up @@ -49,13 +49,15 @@ const SidebarObject = observer(class SidebarObject extends React.Component<{}, S
const items = this.getItems();
const isAllowedObject = this.isAllowedObject();
const typeOptions = this.getTypeOptions();
const rootId = keyboard.getRootId();

const rowRenderer = (param: any) => {
const item: any = items[param.index];
if (!item) {
return null;
};

const cn = [ 'item', U.Data.layoutClass(item.id, item.layout) ];
const type = S.Record.getTypeById(item.type);

let iconSmall = null;
Expand All @@ -69,6 +71,10 @@ const SidebarObject = observer(class SidebarObject extends React.Component<{}, S
iconLarge = <IconObject object={item} size={48} />;
};

if (item.id == rootId) {
cn.push('active');
};

return (
<CellMeasurer
key={param.key}
Expand All @@ -78,7 +84,7 @@ const SidebarObject = observer(class SidebarObject extends React.Component<{}, S
rowIndex={param.index}
>
<div
className={[ 'item', U.Data.layoutClass(item.id, item.layout) ].join(' ')}
className={cn.join(' ')}
style={param.style}
onClick={() => this.onClick(item)}
>
Expand Down

0 comments on commit 47aa1b5

Please sign in to comment.