-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmenu.gs
More file actions
32 lines (27 loc) · 754 Bytes
/
menu.gs
File metadata and controls
32 lines (27 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function onInstall(e) {
onOpen(e);
}
function onOpen(e) {
SpreadsheetApp.getUi()
.createAddonMenu()
.addItem('Start', 'showStartSidebar')
.addSeparator()
.addItem('About CB_Inventory', 'showAboutDialog')
.addToUi();
}
function showStartSidebar(targetViewId, targetTitle) {
JobManager.showJobSidebar({
mode: 'menu',
title: targetTitle || 'Main Menu',
targetViewId: targetViewId || 'menuView'
});
}
function showAboutDialog() {
const content = getAboutContent();
const template = HtmlService.createTemplateFromFile('About');
template.content = content;
const html = template.evaluate()
.setWidth(600)
.setHeight(450);
SpreadsheetApp.getUi().showModalDialog(html, 'About CB_Inventory');
}