Skip to content

Commit

Permalink
2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Aug 13, 2019
1 parent cd38a7d commit 42286be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions dist/details-element-polyfill.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
/*
Details Element Polyfill 2.3.1
Details Element Polyfill 2.4.0
Copyright © 2019 Javan Makhmali
*/
(function() {
"use strict";
var element = document.createElement("details");
element.innerHTML = "<summary>a</summary>b";
element.setAttribute("style", "position: absolute; left: -9999px");
var elementIsNative = typeof HTMLDetailsElement != "undefined" && element instanceof HTMLDetailsElement;
var support = {
open: "open" in element && elementExpands(),
open: "open" in element || elementIsNative,
toggle: "ontoggle" in element
};
function elementExpands() {
(document.body || document.documentElement).appendChild(element);
var closedHeight = element.offsetHeight;
element.open = true;
var openedHeight = element.offsetHeight;
element.parentNode.removeChild(element);
return closedHeight != openedHeight;
}
var styles = '\ndetails, summary {\n display: block;\n}\ndetails:not([open]) > *:not(summary) {\n display: none;\n}\nsummary::before {\n content: "►";\n padding-right: 0.3rem;\n font-size: 0.6rem;\n cursor: default;\n}\n[open] > summary::before {\n content: "▼";\n}\n';
var _ref = [], forEach = _ref.forEach, slice = _ref.slice;
if (!support.open) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "details-element-polyfill",
"version": "2.3.1",
"version": "2.4.0",
"description": "HTML <details> element polyfill",
"main": "dist/details-element-polyfill.js",
"files": [
Expand Down

0 comments on commit 42286be

Please sign in to comment.