Skip to content

Commit

Permalink
adds global handler on middle mouse click
Browse files Browse the repository at this point in the history
prevents middle mouse click on element from openning new tabs in user browser refs: #543
  • Loading branch information
plucik authored and eug3nix committed Nov 4, 2024
1 parent 1e68340 commit dfb3c77
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pgmanage/app/static/pgmanage_frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ ace.config.setModuleUrl('ace/theme/omnidb_dark', omniDarkURL)

axios.defaults.headers.common['X-CSRFToken'] = getCookie(v_csrf_cookie_name);

document.addEventListener('auxclick', function(event) {
if (event.button === 1) {
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
return false;
}
});

settingsStore.getSettings().then(() => {
const app = createApp(App);
setupLogger(app);
Expand Down

0 comments on commit dfb3c77

Please sign in to comment.