Socket
Socket
Sign inDemoInstall

@github/details-menu-element

Package Overview
Dependencies
Maintainers
14
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/details-menu-element - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

24

dist/index.esm.js

@@ -53,2 +53,9 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

details.addEventListener('toggle', closeCurrentMenu);
if (this.preload) {
details.addEventListener('mouseover', loadFragment, {
once: true
});
}
var subscriptions = [focusOnOpen(details)];

@@ -99,4 +106,19 @@ states.set(this, {

details.removeEventListener('toggle', closeCurrentMenu);
details.removeEventListener('mouseover', loadFragment, {
once: true
});
}
}, {
key: "preload",
get: function get() {
return this.hasAttribute('preload');
},
set: function set(value) {
if (value) {
this.setAttribute('preload', '');
} else {
this.removeAttribute('preload');
}
}
}, {
key: "src",

@@ -125,3 +147,3 @@ get: function get() {

if (loader) {
if (loader && !loader.hasAttribute('src')) {
loader.addEventListener('loadend', function () {

@@ -128,0 +150,0 @@ return autofocus(details);

@@ -73,2 +73,9 @@ (function (global, factory) {

details.addEventListener('toggle', closeCurrentMenu);
if (this.preload) {
details.addEventListener('mouseover', loadFragment, {
once: true
});
}
var subscriptions = [focusOnOpen(details)];

@@ -119,4 +126,19 @@ states.set(this, {

details.removeEventListener('toggle', closeCurrentMenu);
details.removeEventListener('mouseover', loadFragment, {
once: true
});
}
}, {
key: "preload",
get: function get() {
return this.hasAttribute('preload');
},
set: function set(value) {
if (value) {
this.setAttribute('preload', '');
} else {
this.removeAttribute('preload');
}
}
}, {
key: "src",

@@ -145,3 +167,3 @@ get: function get() {

if (loader) {
if (loader && !loader.hasAttribute('src')) {
loader.addEventListener('loadend', function () {

@@ -148,0 +170,0 @@ return autofocus(details);

2

package.json
{
"name": "@github/details-menu-element",
"version": "0.7.0",
"version": "0.8.0",
"description": "A menu opened with a <details> button.",

@@ -5,0 +5,0 @@ "main": "dist/index.umd.js",

@@ -81,3 +81,3 @@ # &lt;details-menu&gt; element

<summary>Robots</summary>
<details-menu src="/robots">
<details-menu src="/robots" preload>
<include-fragment>Loading…</include-fragment>

@@ -91,2 +91,6 @@ </details-menu>

If the `preload` attribute is present, the server fetch will begin on mouse
hover over the `<details>` button, so the content may be loaded by the time
the menu is opened.
## Browser support

@@ -93,0 +97,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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