Giter Club home page Giter Club logo

atom-quick-pane's Introduction

atom-quick-pane

stable

Quick and easy pane creation for Atom.

It was difficult finding documentation for how to set up a new pane that just required dealing with a <div> or custom element, and there's still the need to adhere to Atom's Model/View pattern currently. This package provides a simpler API for one-off panes when that's all you need.

Usage

NPM

pane(options, setup, teardown)

All options and arguments are optional.

Options

  • options.title: the title to include in the tab for the pane.
  • options.split: either 'left' or 'right'.
  • options.activatePane: A Boolean indicating whether to call Pane::activate on containing pane. Defaults to true.
  • options.element: the element to use for the contents of the pane. This may be one of:
    • a string node name, e.g. div or table.
    • a function/constructor returning a new HTMLElement.
    • an existing HTMLElement.

setup(err, element)

Called when the pane is created and set up in the editor. element is the result of options.element.

teardown()

Called when the pane has been closed and needs to be cleaned up.

Example

const Pane = require('atom-quick-pane')

Pane({
  element: 'div',
  title: 'Hello World!'
}, function (err, div) {
  if (err) throw err

  div.innerHTML = 'Hi there!'
}, function () {
  // clean up any event listeners or other resources here
})

License

MIT, see LICENSE.md for details.

atom-quick-pane's People

Contributors

hughsk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.