Socket
Socket
Sign inDemoInstall

dile-close-document-click-mixin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dile-close-document-click-mixin

Mixin to close custom elements when user do click in any area of the document.


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

DileCloseDocumentClickMixin

Mixin to close custom elements when user do click in any area of the document.

This mixin, that you may apply to any Custom Element, offers a way to close elements when the user clicks in any area of the document.

Usage

Install it:

npm i dile-close-document-click-mixin

To use it you olny need to extend your custom element class with the mixin.

import { DileCloseDocumentClickMixin } from 'dile-close-document-click-mixin/dile-close-document-click-mixin.js';

class MyElement extends DileCloseDocumentClickMixin(HTMLElement) {
  // your custom element code...
}

To do it's work, the mixin depends on a close() method created in your custom element class.

Available methods

The mixin also provides two utility methods:

  • closeAll(): Close all the elements of this type
  • closeOthers(): Close the other items of this type (distinct to this)

Keywords

FAQs

Package last updated on 02 Aug 2019

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