Created
January 14, 2016 17:36
-
-
Save erickoledadevrel/1d2f92d0475f8bf2e332 to your computer and use it in GitHub Desktop.
Polling in a sidebar only when the page is visible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen() { | |
SpreadsheetApp.getUi().createMenu('Testing') | |
.addItem('Show Sidebar', 'showSidebar') | |
.addToUi(); | |
} | |
function showSidebar() { | |
var sidebar = HtmlService.createHtmlOutputFromFile('Sidebar') | |
.setSandboxMode(HtmlService.SandboxMode.IFRAME) | |
.setTitle('Sidebar'); | |
SpreadsheetApp.getUi().showSidebar(sidebar); | |
} | |
function getActiveRange() { | |
return SpreadsheetApp.getActiveRange().getA1Notation(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment