File tree Expand file tree Collapse file tree 9 files changed +55
-74
lines changed Expand file tree Collapse file tree 9 files changed +55
-74
lines changed Original file line number Diff line number Diff line change 1- <script src =" dist/scripts/helix-ui.polyfills.js" ></script >
2- <script src =" https://cdn.polyfill.io/v2/polyfill.min.js" ></script >
3-
41<!-- intelligently load ES5 Adapter (if needed) -->
52<span id =" ce-es5-adapter" >
63 <script >
Original file line number Diff line number Diff line change @@ -99,9 +99,6 @@ <h2>Right Panel</h2>
9999 <!-- FIXME: point to HelixUI polyfills in node_modules/helix-ui -->
100100 < script src ="dist/scripts/helix-ui.polyfills.min.js "> </ script >
101101
102- <!-- Browser polyfills (mainly for IE) -->
103- < script src ="https://cdn.polyfill.io/v2/polyfill.min.js "> </ script >
104-
105102 <!-- intelligently load ES5 Adapter (if needed) -->
106103 < span id ="ce-es5-adapter ">
107104 < script >
Original file line number Diff line number Diff line change @@ -94,9 +94,6 @@ <h1>Page Content</h1>
9494 <!-- FIXME: point to HelixUI polyfills in node_modules/helix-ui -->
9595 < script src ="dist/scripts/helix-ui.polyfills.min.js "> </ script >
9696
97- <!-- Browser polyfills (mainly for IE) -->
98- < script src ="https://cdn.polyfill.io/v2/polyfill.min.js "> </ script >
99-
10097 <!-- intelligently load ES5 Adapter (if needed) -->
10198 < span id ="ce-es5-adapter ">
10299 < script >
Original file line number Diff line number Diff line change @@ -120,33 +120,4 @@ export default [
120120 lessPlugin ,
121121 ] ,
122122 } ,
123-
124- // src/polyfills.js --> dis/helix-ui.polyfills.js (IIFE)
125- {
126- input : 'src/polyfills.js' ,
127- output : [
128- {
129- file : 'dist/scripts/helix-ui.polyfills.js' ,
130- format : 'iife' ,
131- }
132- ] ,
133- plugins : [
134- babelPlugin ,
135- ] ,
136- } ,
137-
138- // src/polyfills.js --> dis/helix-ui.polyfills.min.js (IIFE)
139- {
140- input : 'src/polyfills.js' ,
141- output : [
142- {
143- file : 'dist/scripts/helix-ui.polyfills.min.js' ,
144- format : 'iife' ,
145- }
146- ] ,
147- plugins : [
148- babelPlugin ,
149- uglify ( { } , minify ) ,
150- ] ,
151- } ,
152123]
Original file line number Diff line number Diff line change 1+ import './polyfills/ChildNode' ;
2+ import './polyfills/Element' ;
13import HelixUI from './helix-ui/index' ;
24
35// add HelixUI to global scope if not already defined
46if ( ! window . HelixUI ) {
57 window . HelixUI = HelixUI ;
68}
79
10+ // Initialize on load
811HelixUI . initialize ( ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // Modified from https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove#Polyfill
2+ [
3+ Element . prototype ,
4+ CharacterData . prototype ,
5+ DocumentType . prototype ,
6+ ] . forEach ( function ( proto ) {
7+ if ( ! proto . hasOwnProperty ( 'remove' ) ) {
8+ Object . defineProperty ( proto , 'remove' , {
9+ configurable : true ,
10+ enumerable : true ,
11+ writable : true ,
12+ value : function ( ) {
13+ if ( this . parentNode !== null ) {
14+ this . parentNode . removeChild ( this ) ;
15+ }
16+ } ,
17+ } ) ;
18+ }
19+ } ) ;
Original file line number Diff line number Diff line change 1+ // Modified from https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
2+
3+ /*
4+ * If browser supports a variation of matches(), (IE9+)
5+ * normalize to 'matches' on the prototype.
6+ */
7+ if ( ! Element . prototype . matches ) {
8+ Element . prototype . matches = Element . prototype . msMatchesSelector ||
9+ Element . prototype . webkitMatchesSelector ;
10+ }
11+
12+ if ( ! Element . prototype . closest ) {
13+ Element . prototype . closest = function ( selectors ) {
14+ var el = this ;
15+
16+ // fail fast if element isn't attached to the document
17+ if ( ! document . documentElement . contains ( el ) ) {
18+ return null ;
19+ }
20+
21+ // Check if any ancestors match selectors
22+ while ( el !== null && el . nodetype === 1 ) {
23+ if ( el . matches ( selectors ) ) {
24+ return el ;
25+ } else {
26+ el = el . parentElement || el . parentNode ;
27+ }
28+ }
29+
30+ // Return null if no ancestors match
31+ return null ;
32+ } ;
33+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments