Socket
Socket
Sign inDemoInstall

atom-pane

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    atom-pane

A lightweight wrapper for creating new panes within Atom


Version published
Weekly downloads
3
decreased by-70%
Maintainers
1
Install size
6.35 kB
Created
Weekly downloads
 

Readme

Source

atom-pane Flattr this!stable

A lightweight wrapper for creating new panes within Atom.

Usage

atom-pane

atom-pane is packaged as an npm module, so you can simply install it like you would your other package dependencies.

uri = createPane([opts], ready, [closed])

Create a new pane, calling ready(err, pane) when complete. The returned pane is an instance of ScrollView, but you can easily append standard DOM elements like so:

var createPane = require('atom-pane')

exports.activate = function() {
  atom.workspaceView.command('atom-plugin:open', function() {
    // create a div, any div
    var div = document.createElement('div')
    div.innerHTML = 'hello world!'
    div.style.color = '#fff'

    createPane(function(err, pane) {
      if (err) throw err
      // append the dive to your new pane
      pane.append(div)
    }, function() {
      div.parentNode.removeChild(div)
    })
  })
}

You'll need to clean up after yourself too – use the closed callback function, which will get called when the pane has been closed.

Takes the following options:

  • opts.searchAllPanes passed onto atom.workspace.open, defaults to false.

  • opts.uri may be one of the following:

    • undefined, in which case a unique value will be genrated for you.
    • A unique string, e.g. markdown-preview-pane.
    • A full URI, e.g. markdown-preview://Users/hughsk/README.md.

    Note that the latter two approaches are recommended, to prevent creating a bunch of one-off openers each time a user opens a pane.

  • opts.changeFocus passed onto atom.workspace.open, defaults to true.

  • opts.split passed onto atom.workspace.open, defaults to undefined.

License

MIT. See LICENSE.md for details.

Keywords

FAQs

Last updated on 29 May 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc