Skip to content

Commit 64e0f84

Browse files
committed
[DEMO] Use keyboard shortcuts
1 parent fa517bb commit 64e0f84

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

webapp/manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"type": "application"
66
},
77
"sap.ui5": {
8+
"commands": {
9+
"Clear": {
10+
"shortcut": "Ctrl+X"
11+
}
12+
},
813
"dependencies": {
914
"minUI5Version": "1.121.0",
1015
"libs": {

webapp/view/App.view.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core" xmlns="sap.m" xmlns:f="sap.f" controllerName="sap.ui.demo.todo.controller.App" displayBlock="true">
22
<App>
33
<Page>
4+
<dependents>
5+
<core:CommandExecution id="CE_CLEAR_COMPLETED" command="Clear" enabled="true" execute=".onClearCompleted" />
6+
</dependents>
47
<customHeader>
58
<f:ShellBar core:require="{ Helper: 'sap/ui/demo/todo/util/Helper' }" title="{i18n>TITLE}" homeIcon="{:= Helper.resolvePath('./img/logo_ui5.png') }" />
69
</customHeader>
@@ -31,7 +34,7 @@
3134
<SegmentedButtonItem text="{i18n>LABEL_COMPLETED}" key="completed"/>
3235
</items>
3336
</SegmentedButton>
34-
<Button id="clearCompleted" enabled="{/itemsRemovable}" icon="sap-icon://delete" text="{i18n>CLEAR_COMPLETED}" press=".onClearCompleted"/>
37+
<Button id="clearCompleted" enabled="{/itemsRemovable}" icon="sap-icon://delete" text="{i18n>CLEAR_COMPLETED}" press="cmd:Clear"/>
3538
</OverflowToolbar>
3639
</headerToolbar>
3740
<infoToolbar>
@@ -69,7 +72,7 @@
6972
</items>
7073
</SegmentedButton>
7174
<ToolbarSpacer />
72-
<Button id="clearCompleted-footer" enabled="{/itemsRemovable}" icon="sap-icon://delete" text="{i18n>CLEAR_COMPLETED}" press=".onClearCompleted"/>
75+
<Button id="clearCompleted-footer" enabled="{/itemsRemovable}" icon="sap-icon://delete" text="{i18n>CLEAR_COMPLETED}" press="cmd:Clear"/>
7376
</OverflowToolbar>
7477
</footer>
7578

0 commit comments

Comments
 (0)