File tree Expand file tree Collapse file tree 2 files changed +134
-64
lines changed Expand file tree Collapse file tree 2 files changed +134
-64
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ class JavascriptRenderer
70
70
71
71
protected $ ajaxHandlerClass = 'PhpDebugBar.AjaxHandler ' ;
72
72
73
+ protected $ ajaxHandlerBindToFetch = false ;
74
+
73
75
protected $ ajaxHandlerBindToJquery = true ;
74
76
75
77
protected $ ajaxHandlerBindToXHR = false ;
@@ -477,6 +479,27 @@ public function getAjaxHandlerClass()
477
479
return $ this ->ajaxHandlerClass ;
478
480
}
479
481
482
+ /**
483
+ * Sets whether to call bindToFetch() on the ajax handler
484
+ *
485
+ * @param boolean $bind
486
+ */
487
+ public function setBindAjaxHandlerToFetch ($ bind = true )
488
+ {
489
+ $ this ->ajaxHandlerBindToFetch = $ bind ;
490
+ return $ this ;
491
+ }
492
+
493
+ /**
494
+ * Checks whether bindToFetch() will be called on the ajax handler
495
+ *
496
+ * @return boolean
497
+ */
498
+ public function isAjaxHandlerBoundToFetch ()
499
+ {
500
+ return $ this ->ajaxHandlerBindToFetch ;
501
+ }
502
+
480
503
/**
481
504
* Sets whether to call bindToJquery() on the ajax handler
482
505
*
@@ -1022,6 +1045,9 @@ protected function getJsInitializationCode()
1022
1045
$ this ->variableName ,
1023
1046
$ this ->ajaxHandlerAutoShow ? 'true ' : 'false '
1024
1047
);
1048
+ if ($ this ->ajaxHandlerBindToFetch ) {
1049
+ $ js .= sprintf ("%s.ajaxHandler.bindToFetch(); \n" , $ this ->variableName );
1050
+ }
1025
1051
if ($ this ->ajaxHandlerBindToXHR ) {
1026
1052
$ js .= sprintf ("%s.ajaxHandler.bindToXHR(); \n" , $ this ->variableName );
1027
1053
} elseif ($ this ->ajaxHandlerBindToJquery ) {
You can’t perform that action at this time.
0 commit comments