فهرست منبع

add conditional checks for ie11 for code differences

Keyur Shah 5 سال پیش
والد
کامیت
6e8f18e0ca
7فایلهای تغییر یافته به همراه9 افزوده شده و 7 حذف شده
  1. 0 0
      dist/alpine-ie11.js
  2. 0 0
      dist/alpine-ie11.js.map
  3. 0 0
      dist/alpine.js
  4. 0 0
      dist/alpine.js.map
  5. 2 3
      examples/index_ie11.html
  6. 5 3
      src/component.js
  7. 2 1
      src/directives/model.js

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/alpine-ie11.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/alpine-ie11.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/alpine.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/alpine.js.map


+ 2 - 3
examples/index_ie11.html

@@ -38,7 +38,7 @@
         </thead>
         <tbody>
             <tr>
-                <td>Simple x-if</td>
+                <td>Simple x-if (not working in IE11)</td>
                 <td>
                     <div x-data="{ show: false }">
                         <template x-if="show">
@@ -210,7 +210,6 @@
                     </script>
                 </td>
             </tr>
-
             <tr>
                 <td>Transitions</td>
                 <td>
@@ -249,7 +248,7 @@
             </tr>
 
             <tr>
-                <td>Transitions (with x-if)</td>
+                <td>Transitions (with x-if) (not working in IE11)</td>
                 <td>
                     <div x-data="{ open: false }">
                         <button x-on:click="open= ! open">

+ 5 - 3
src/component.js

@@ -20,9 +20,11 @@ export default class Component {
 
         // For IE11, add our magic properties to the original data for access.
         // Since the polyfill proxy does not allow properties to be added after creation 
-        unobservedData.$el = null 
-        unobservedData.$refs = null 
-        unobservedData.$nextTick = null 
+        if (window.document.documentMode) {
+            unobservedData.$el = null 
+            unobservedData.$refs = null 
+            unobservedData.$nextTick = null 
+        }
 
         // Construct a Proxy-based observable. This will be used to handle reactivity.
         this.$data = this.wrapDataInObservable(unobservedData)

+ 2 - 1
src/directives/model.js

@@ -27,7 +27,8 @@ function generateModelAssignmentFunction(el, modifiers, expression) {
     }
 
     return (event, currentValue) => {
-        if (event instanceof CustomEvent && event.detail) {
+        //check for non IE11. due to an issue where IE11 handles the event as a CustomEvent. The event should be undefined
+        if (event instanceof CustomEvent && !window.document.documentMode) {
             return event.detail
         } else if (el.type === 'checkbox') {
             // If the data we are binding to is an array, toggle it's value inside the array.

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است