Add documentation to addModalPanel api

This commit is contained in:
Will Binns-Smith
2017-08-14 09:56:43 -07:00
parent 236065d0f6
commit 128f702784
3 changed files with 8 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ class PanelContainerElement extends HTMLElement {
if (this.model.isModal()) {
this.hideAllPanelsExcept(panel)
this.subscriptions.add(panel.onDidChangeVisible(visible => {
if (visible) this.hideAllPanelsExcept(panel)
if (visible) { this.hideAllPanelsExcept(panel) }
}))
if (panel.autoFocus) {

View File

@@ -1752,6 +1752,11 @@ module.exports = class Workspace extends Model {
// (default: true)
// * `priority` (optional) {Number} Determines stacking order. Lower priority items are
// forced closer to the edges of the window. (default: 100)
// * `autoFocus` (optional) {Boolean} true if you want modal focus managed for you by Atom.
// Atom will automatically focus your modal panel's first tabbable element when the modal
// opens and will restore the previously selected element when the modal closes. Atom will
// also automatically restrict user tab focus within your modal while it is open.
// (default: false)
//
// Returns a {Panel}
addModalPanel (options = {}) {