DEV: Remove the <details> polyfill (#10260)

DEV: Remove the

polyfill (#10260)

Per the linked site (http://mths.be/details) and Can I use... Support tables for HTML5, CSS3, etc the

element is supported since Chrome 12/Safari 6/Firefox 49/Edge 79. IE 11 doesn’t handle them, but we dropped the support for that browser.
diff --git a/plugins/discourse-details/assets/javascripts/details.js b/plugins/discourse-details/assets/javascripts/details.js
deleted file mode 100644
index 5443678..0000000
--- a/plugins/discourse-details/assets/javascripts/details.js
+++ /dev/null
@@ -1,58 +0,0 @@
-(function(document, $) {
-
-  // cf. http://mths.be/details
-  var hasNativeSupport = (function(doc) {
-    var fake, el = doc.createElement("details");
-    // fail-fast
-    if (!("open" in el)) { return false; }
-    // figure out a root node
-    var root = doc.body || (function() {
-      var de = doc.documentElement;
-      fake = true;
-      return de.insertBefore(doc.createElement("body"), de.firstElementChild || de.firstChild);
-    })();
-    // setup test element
-    el.innerHTML = "<summary>a</summary>b";
-    el.style.display = "block";
-    // add test element to the root node
-    root.appendChild(el);
-    // can we open it?
-    var diff = el.offsetHeight;
-    el.open = true;
-    diff = diff !== el.offsetHeight;
-    // cleanup
-    root.removeChild(el);
-    if (fake) { root.parentNode.removeChild(root); }
-    // return the result
-    return diff;
-  })(document);
-
-  function toggleOpen($details) {
-    $details.toggleClass("open");
-  }
-
-  $.fn.details = function() {
-    if (hasNativeSupport) { return this; }
-
-    return this.each(function() {
-      var $details = $(this),
-          $firstSummary = $("summary", $details).first();
-
-      $firstSummary.prop("tabIndex", 0);
-
-      $firstSummary.on("keydown", function(event) {
-        if (event.keyCode === 32 /* SPACE */ || event.keyCode === 13 /* ENTER */) {
-          toggleOpen($details);
-          return false;
-        }
-      });
-
-      $firstSummary.on("click", function() {
-        $firstSummary.focus();
-        toggleOpen($details);
-      });
-
-    });
-  };
-
-})(document, jQuery);
diff --git a/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6 b/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6
index 65e7eb3..24ee6e1 100644
--- a/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6
+++ b/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6
@@ -2,7 +2,7 @@ import I18n from "I18n";
 import { withPluginApi } from "discourse/lib/plugin-api";
 
 function initializeDetails(api) {
-  api.decorateCooked($elem => $("details", $elem).details(), {
+  api.decorateCooked($elem => $("details", $elem), {
     id: "discourse-details"
   });
 
diff --git a/plugins/discourse-details/plugin.rb b/plugins/discourse-details/plugin.rb
index 4d8a9b7..6d3d1ef 100644
--- a/plugins/discourse-details/plugin.rb
+++ b/plugins/discourse-details/plugin.rb
@@ -9,7 +9,6 @@
 enabled_site_setting :details_enabled
 hide_plugin if self.respond_to?(:hide_plugin)
 
-register_asset "javascripts/details.js"
 register_asset "stylesheets/details.scss"
 
 after_initialize do

GitHub sha: 8f2f9e6a

This commit appears in #10260 which was approved by ZogStriP. It was merged by CvX.