Skip to content

Commit badf6e2

Browse files
committed
Toggle to the object property when clicking on an already selected object
1 parent 67bf03c commit badf6e2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

newIDE/app/src/LayersList/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ import {
3131
getLayerTreeViewItemId,
3232
type LayerTreeViewItemProps,
3333
} from './LayerTreeViewItemContent';
34-
import {
35-
BackgroundColorTreeViewItemContent,
36-
} from './BackgroundColorTreeViewItemContent';
34+
import { BackgroundColorTreeViewItemContent } from './BackgroundColorTreeViewItemContent';
3735
import { type MenuItemTemplate } from '../UI/Menu/Menu.flow';
3836
import useAlertDialog from '../UI/Alert/useAlertDialog';
3937
import { type ShowConfirmDeleteDialogOptions } from '../UI/Alert/AlertContext';

newIDE/app/src/ObjectsList/ObjectTreeViewItemContent.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ export class ObjectTreeViewItemContent implements TreeViewItemContent {
241241
);
242242
}
243243

244-
onClick(): void {}
244+
onClick(): void {
245+
this.props.selectObjectFolderOrObjectWithContext({
246+
objectFolderOrObject: this.object,
247+
global: this._isGlobal,
248+
});
249+
}
245250

246251
rename(newName: string): void {
247252
if (this.getName() === newName) {

newIDE/app/src/ObjectsList/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ const renderTreeViewItemRightComponent = (i18n: I18nType) => (
384384
const renameItem = (item: TreeViewItem, newName: string) => {
385385
item.content.rename(newName);
386386
};
387+
const onClickItem = (item: TreeViewItem) => {
388+
item.content.onClick();
389+
};
387390
const editItem = (item: TreeViewItem) => {
388391
item.content.edit();
389392
};
@@ -1575,6 +1578,7 @@ const ObjectsList = React.forwardRef<Props, ObjectsListInterface>(
15751578
getItemHtmlId={getTreeViewItemHtmlId}
15761579
getItemDataset={getTreeViewItemDataSet}
15771580
onEditItem={editItem}
1581+
onClickItem={onClickItem}
15781582
onCollapseItem={onCollapseItem}
15791583
selectedItems={selectedItems}
15801584
onSelectItems={items => {

0 commit comments

Comments
 (0)