File tree Expand file tree Collapse file tree 7 files changed +83
-6
lines changed Expand file tree Collapse file tree 7 files changed +83
-6
lines changed Original file line number Diff line number Diff line change 1+ <script src =" dist/scripts/helix-ui.polyfills.js" ></script >
12<script src =" https://cdn.polyfill.io/v2/polyfill.min.js" ></script >
23
34<!-- intelligently load ES5 Adapter (if needed) -->
Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ <h2>Right Panel</h2>
100100 {% include 'partials/footer_legal.njk' %}
101101 </ footer >
102102
103+ <!-- FIXME: point to HelixUI polyfills in node_modules/helix-ui -->
104+ < script src ="dist/scripts/helix-ui.polyfills.min.js "> </ script >
105+
103106 <!-- Browser polyfills (mainly for IE) -->
104107 < script src ="https://cdn.polyfill.io/v2/polyfill.min.js "> </ script >
105108
Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ <h1>Page Content</h1>
9797 {% include 'partials/footer_legal.njk' %}
9898 </ footer >
9999
100+ <!-- FIXME: point to HelixUI polyfills in node_modules/helix-ui -->
101+ < script src ="dist/scripts/helix-ui.polyfills.min.js "> </ script >
102+
100103 <!-- Browser polyfills (mainly for IE) -->
101104 < script src ="https://cdn.polyfill.io/v2/polyfill.min.js "> </ script >
102105
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ let lessPlugin = less({
3131 }
3232} ) ;
3333
34+ // Intro/Outro placed INSIDE the applied dependency function
3435let intro = `window.addEventListener('WebComponentsReady', function () {` ;
3536let outro = `});` ;
3637
@@ -114,4 +115,35 @@ export default [
114115 lessPlugin ,
115116 ] ,
116117 } ,
118+
119+ // src/polyfills.js --> dis/helix-ui.polyfills.js (IIFE)
120+ {
121+ input : 'src/polyfills.js' ,
122+ sourcemap : false ,
123+ output : [
124+ {
125+ file : 'dist/scripts/helix-ui.polyfills.js' ,
126+ format : 'iife' ,
127+ }
128+ ] ,
129+ plugins : [
130+ babelPlugin ,
131+ ] ,
132+ } ,
133+
134+ // src/polyfills.js --> dis/helix-ui.polyfills.min.js (IIFE)
135+ {
136+ input : 'src/polyfills.js' ,
137+ sourcemap : false ,
138+ output : [
139+ {
140+ file : 'dist/scripts/helix-ui.polyfills.min.js' ,
141+ format : 'iife' ,
142+ }
143+ ] ,
144+ plugins : [
145+ babelPlugin ,
146+ uglify ( { } , minify ) ,
147+ ] ,
148+ } ,
117149]
Original file line number Diff line number Diff line change @@ -86,12 +86,14 @@ export class HXElement extends HTMLElement {
8686 }
8787 } //$preventScroll()
8888
89- $emit ( evtName , details ) {
90- let evt = new CustomEvent ( evtName , {
89+ $emit ( evtName , opts ) {
90+ let options = Object . assign ( { } , {
9191 cancelable : true ,
92- bubbles : true ,
93- detail : details ,
94- } ) ;
92+ bubbles : false ,
93+ } , opts ) ;
94+
95+ let evt = new CustomEvent ( evtName , options ) ;
96+
9597 return this . dispatchEvent ( evt ) ;
9698 } //$emit
9799
@@ -106,7 +108,7 @@ export class HXElement extends HTMLElement {
106108 bubbles : oldEvent . bubbles ,
107109 cancelable : oldEvent . cancelable ,
108110 } ) ;
109- this . dispatchEvent ( newEvent ) ;
111+ return this . dispatchEvent ( newEvent ) ;
110112 } //$relayEvent()
111113
112114 // TODO: may need a later update to add events based on element name/type
Original file line number Diff line number Diff line change 1+ // Entrypoint for browser polyfills
2+ import './polyfills/Object' ;
Original file line number Diff line number Diff line change 1+ /* ========== Object ========== */
2+
3+ /* ---------- assign() ---------- */
4+ // Affected Browsers: IE
5+ // Source: (MDN) https://goo.gl/UADxBn
6+ if ( typeof Object . assign != 'function' ) {
7+ // Must be writable: true, enumerable: false, configurable: true
8+ Object . defineProperty ( Object , "assign" , {
9+ value : function assign ( target , varArgs ) { // .length of function is 2
10+ 'use strict' ;
11+ if ( target == null ) { // TypeError if undefined or null
12+ throw new TypeError ( 'Cannot convert undefined or null to object' ) ;
13+ }
14+
15+ var to = Object ( target ) ;
16+
17+ for ( var index = 1 ; index < arguments . length ; index ++ ) {
18+ var nextSource = arguments [ index ] ;
19+
20+ if ( nextSource != null ) { // Skip over if undefined or null
21+ for ( var nextKey in nextSource ) {
22+ // Avoid bugs when hasOwnProperty is shadowed
23+ if ( Object . prototype . hasOwnProperty . call ( nextSource , nextKey ) ) {
24+ to [ nextKey ] = nextSource [ nextKey ] ;
25+ }
26+ }
27+ }
28+ }
29+ return to ;
30+ } ,
31+ writable : true ,
32+ configurable : true
33+ } ) ;
34+ } //Object.assign()
You can’t perform that action at this time.
0 commit comments