@lemuria/popup

1.1.1 • Public • Published

@lemuria/popup

npm version

@lemuria/popup is The Function To Open A Popup.

yarn add @lemuria/popup

Table Of Contents

API

The package is available by importing its default function:

import Popup from '@lemuria/popup'

The package publishes both main and module fields, where main exports a CommonJS module (require), and module exports an ES6 module (import).

Popup(
  url: string,
  title: string,
  width=: ?number,
  height=: ?number,
  features=: !Object<string, string>,
): Window

Opens a popup in the middle of the screen by setting width/left and height/top properties according to the arguments. See https://developer.mozilla.org/en-US/docs/Web/API/Window/open for all features. Returns the reference to the window.

  • url* string: The URL to open.
  • title* string: The window title.
  • width ?number (optional): The width of the popup. Enables horizontal centering.
  • height ?number (optional): The height of the popup. Enables vertical centering.
  • features !Object<string, string> (optional): Window features. When compiling with Closure Compiler, some properties might need to appear in quotes, e.g., { 'status': 'no' } as there are no externs for them.
import Popup from '@lemuria/popup'

const editor = Popup('/admin/editor', 'Editor', 900, 650, {
  menubar: 'yes',
})

Copyright

Window features are copyright of MDN authors.

Art Deco © Art Deco 2019 Tech Nation Visa Tech Nation Visa Sucks

Readme

Keywords

Package Sidebar

Install

npm i @lemuria/popup

Homepage

artd.eco/

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

11.4 kB

Total Files

13

Last publish

Collaborators

  • zvr