Skip to content

Commit

Permalink
Move ajax clear event listener initialization on loadToolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno BOUTAREL committed Jun 2, 2020
1 parent a2f4342 commit cf4587b
Showing 1 changed file with 6 additions and 7 deletions.
Expand Up @@ -131,13 +131,6 @@
removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
removeClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
}
addEventListener(document.querySelector('.sf-toolbar-ajax-clear'), 'click', function() {
requestStack = [];
renderAjaxRequests();
successStreak = 4;
document.querySelector('.sf-toolbar-ajax-request-list').innerHTML = '';
});
};
var startAjaxRequest = function(index) {
Expand Down Expand Up @@ -506,6 +499,12 @@
setPreference('toolbar/displayState', 'block');
});
renderAjaxRequests();
addEventListener(document.querySelector('.sf-toolbar-ajax-clear'), 'click', function() {
requestStack = [];
renderAjaxRequests();
successStreak = 4;
document.querySelector('.sf-toolbar-ajax-request-list').innerHTML = '';
});
addEventListener(document.querySelector('.sf-toolbar-block-ajax'), 'mouseenter', function (event) {
var elem = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
elem.scrollTop = elem.scrollHeight;
Expand Down

0 comments on commit cf4587b

Please sign in to comment.