Skip to content

Commit

Permalink
Merge pull request #403 from dew326/dbl-click
Browse files Browse the repository at this point in the history
EZP-28682: Error 404 after fast double click
  • Loading branch information
Łukasz Serwatka authored Mar 20, 2018
2 parents 45bad38 + c2a49b0 commit 1c8986f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bundle/Resources/public/js/scripts/admin.prevent.click.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function (global, doc) {
global.onbeforeunload = function() {
doc.querySelector('body').classList.add('ez-prevent-click');

return null;
};
})(window, document);
5 changes: 5 additions & 0 deletions src/bundle/Resources/public/scss/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,8 @@ button {
max-height: 60vh;
overflow: auto;
}

.ez-prevent-click,
.ez-prevent-click * {
pointer-events: none !important;
}
1 change: 1 addition & 0 deletions src/bundle/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
'bundles/ezplatformadminui/js/scripts/button.prevent.default.js'
'bundles/ezplatformadminui/js/scripts/udw/browse.js'
'bundles/ezplatformadminui/js/scripts/admin.user.menu.js'
'bundles/ezplatformadminui/js/scripts/admin.prevent.click.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
Expand Down

0 comments on commit 1c8986f

Please sign in to comment.