Просмотр исходного кода

Improvement: Detach code blocks correctly

* set order of DetachCodeBlockInterceptor/RestoreCodeBlockInterceptor
Yuki Takei 7 лет назад
Родитель
Сommit
732b2dcd1c
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      resource/js/util/Crowi.js

+ 2 - 4
resource/js/util/Crowi.js

@@ -30,10 +30,8 @@ export default class Crowi {
     this.apiRequest = this.apiRequest.bind(this);
     this.apiRequest = this.apiRequest.bind(this);
 
 
     this.interceptorManager = new InterceptorManager();
     this.interceptorManager = new InterceptorManager();
-    this.interceptorManager.addInterceptors([
-      new DetachCodeBlockInterceptor(this),
-      new RestoreCodeBlockInterceptor(this),
-    ]);
+    this.interceptorManager.addInterceptor(new DetachCodeBlockInterceptor(this), 10);       // process as soon as possible
+    this.interceptorManager.addInterceptor(new RestoreCodeBlockInterceptor(this), 900);     // process as late as possible
 
 
     // FIXME
     // FIXME
     this.me = context.me;
     this.me = context.me;