Quellcode durchsuchen

修复Dcat.init监听会被异步弹窗解绑问题

jqh vor 4 Jahren
Ursprung
Commit
13a2fba081

+ 17 - 15
resources/assets/dcat/js/Dcat.js

@@ -112,28 +112,30 @@ export default class Dcat {
                 }
             };
 
-        $document.one('pjax:loaded', clear);
+        $document.one('pjax:complete', clear);
         $document.one('init:off', clear);
 
         clear();
 
-        initialized[selector] = $.initialize(selector, function () {
-            let $this = $(this),
-                id = $this.attr('id');
+        setTimeout(function () {
+            initialized[selector] = $.initialize(selector, function () {
+                let $this = $(this),
+                    id = $this.attr('id');
 
-            if ($this.attr('initialized')) {
-                return;
-            }
-            $this.attr('initialized', '1');
+                if ($this.attr('initialized')) {
+                    return;
+                }
+                $this.attr('initialized', '1');
 
-            // 如果没有ID,则自动生成
-            if (! id) {
-                id = "_"+self.helpers.random();
-                $this.attr('id', id);
-            }
+                // 如果没有ID,则自动生成
+                if (! id) {
+                    id = "_"+self.helpers.random();
+                    $this.attr('id', id);
+                }
 
-            callback.call(this, $this, id)
-        }, options);
+                callback.call(this, $this, id)
+            }, options);
+        });
     }
 
     offInit() {

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.