소스 검색

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

jqh 4 년 전
부모
커밋
13a2fba081
3개의 변경된 파일17개의 추가작업 그리고 15개의 파일을 삭제
  1. 17 15
      resources/assets/dcat/js/Dcat.js
  2. 0 0
      resources/dist/dcat/js/dcat-app.js
  3. 0 0
      resources/dist/dcat/js/dcat-app.js.map

+ 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() {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.