Learning Google Apps Script
上QQ阅读APP看书,第一时间看更新

Creating a modeless dialog

Now we will create a modeless dialog and see the difference between modal and modeless dialogs. Update the showDialog function as shown here:

function showDialog() {
  var html = HtmlService.createHtmlOutputFromFile('Index');
  DocumentApp.getUi()
  .showModelessDialog(html, 'Greeting');
}

Note that the showModalDialog method has been changed to showModelessDialog.

Modeless dialogs do not prevent you from doing other things, such as editing the document, and you can drag the dialog around as shown here: