Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ay-dialog

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ay-dialog

An HTML5 spec-compliant <dialog> polyfill.

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

ayDialog

An HTML5 spec-compliant <dialog> polyfill built with Angular 1.x.

Copyright © 2016 Ayogo Health Inc.

Features

  • Automatic upgrading of dialog elements via Angular directive
  • Support for API methods (show(), showModal(), close(), returnValue)
  • Compatible with native dialog support in Chrome
  • Support for normal and modal dialogs (with backdrops)
  • Proper focus handling and disabling of background content for accessibility

Usage

To get started, install the package from npm: npm install ay-dialog

Basic Usage

Add a script tag to your page to reference the dialog.js file:

<script src="node_modules/ay-dialog/dialog.js"></script>

Reference the module in your Angular app's dependencies:

angular.module(myApp, ['ayDialog'])

ES5 with Browserify

Reference the module in your Angular app's dependencies:

var ayDialog = require('ay-dialog').default;

angular.module(myApp, [ayDialog])

ES6 / TypeScript

Reference the module in your Angular app's dependencies:

import ayDialog from 'ay-dialog';

angular.module(myApp, [ayDialog])

A TypeScript module definition is included, which also provides typings for the HTMLDialogElement interface.

Styling

It's not possible to implement the backdrop as a pseudo-element (as it is in native implementations), so the backdrop is added as a sibling element with a .backdrop class.

Note that you need two separate selectors to support both .backdrop and ::backdrop, otherwise browsers that don't recognize the pseudo-element will skip the CSS block entirely!

dialog + .backdrop {
    background: rgba(1, 0, 0, 0.1);
}

dialog::backdrop {
    background: rgba(1, 0, 0, 0.1);
}

Notes

Released under the terms of the MIT License.

Keywords

FAQs

Package last updated on 26 Nov 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc