Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat deprecate bindtojquery #629

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
7 changes: 2 additions & 5 deletions src/DebugBar/Resources/debugbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
if (!suffix || ('(iframe)').indexOf(suffix) < 0) {
suffix = '(iframe)' + (suffix || '');
}

window.parent.phpdebugbar.addDataSet(data, id, suffix, show);
return;
}
Expand Down Expand Up @@ -1203,10 +1203,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(