Skip to content

Commit

Permalink
Feat deprecate bindtojquery (#629)
Browse files Browse the repository at this point in the history
* Deprecate bindToJquery

* Tweak
  • Loading branch information
barryvdh committed Mar 20, 2024
1 parent 3668109 commit 42beef0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/DebugBar/JavascriptRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class JavascriptRenderer

protected $ajaxHandlerBindToFetch = false;

protected $ajaxHandlerBindToJquery = true;
protected $ajaxHandlerBindToJquery = false;

protected $ajaxHandlerBindToXHR = false;
protected $ajaxHandlerBindToXHR = true;

protected $ajaxHandlerAutoShow = true;

Expand Down Expand Up @@ -509,6 +509,7 @@ public function isAjaxHandlerBoundToFetch()
* Sets whether to call bindToJquery() on the ajax handler
*
* @param boolean $bind
* @deprecated use setBindAjaxHandlerToXHR
*/
public function setBindAjaxHandlerToJquery($bind = true)
{
Expand All @@ -520,6 +521,7 @@ public function setBindAjaxHandlerToJquery($bind = true)
* Checks whether bindToJquery() will be called on the ajax handler
*
* @return boolean
* @deprecated use isAjaxHandlerBoundToXHR
*/
public function isAjaxHandlerBoundToJquery()
{
Expand Down
5 changes: 1 addition & 4 deletions src/DebugBar/Resources/debugbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1204,10 +1204,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
},

/**
* Attaches an event listener to jQuery.ajaxComplete()
*
* @this {AjaxHandler}
* @param {jQuery} jq Optional
* @deprecated use bindToXHR instead
*/
bindToJquery: function(jq) {
var self = this;
Expand Down
2 changes: 1 addition & 1 deletion tests/DebugBar/Tests/full_init.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
});
phpdebugbar.restoreState();
phpdebugbar.ajaxHandler = new PhpDebugBar.AjaxHandler(phpdebugbar, undefined, true);
if (jQuery) phpdebugbar.ajaxHandler.bindToJquery(jQuery);
phpdebugbar.ajaxHandler.bindToXHR();
phpdebugbar.addDataSet(

0 comments on commit 42beef0

Please sign in to comment.