Browse Source

+ ie-polyfills.js

Piotr Labudda 6 năm trước cách đây
mục cha
commit
a275163fde
2 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 3 0
      SE/se-lib/tmpl/_layout_gora.php
  2. 14 0
      SE/static/ie-polyfills.js

+ 3 - 0
SE/se-lib/tmpl/_layout_gora.php

@@ -31,6 +31,9 @@
 	<script src="static/lodash.min.js?_v=4.6.1"></script>
 	<script src="static/superagent.js"></script>
 	<script src="static/validate.min.js"></script>
+	<!--[if IE]>
+		<script src="static/ie-polyfills.js"></script>
+	<![endif]-->
 	<?php S::printTimeoutUpdateJs(); ?>
 	<?php if (DBG::isActive()) : ?>
 		<script>

+ 14 - 0
SE/static/ie-polyfills.js

@@ -0,0 +1,14 @@
+(function () { // window.CustomEvent for ie >= 9
+
+	if ( typeof window.CustomEvent === "function" ) return false;
+
+	function CustomEvent ( event, params ) {
+		params = params || { bubbles: false, cancelable: false, detail: null };
+		var evt = document.createEvent( 'CustomEvent' );
+		evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
+		return evt;
+	}
+
+	window.CustomEvent = CustomEvent;
+})();
+