From 4d3fc3bb09cba528823f06a7c03650549a83a793 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Wed, 29 Jul 2015 09:54:18 +0200 Subject: [PATCH] Fixed accidental back() requests when closing detail dialogs --- rpg-docs/client/globalHelpers/GlobalUI.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpg-docs/client/globalHelpers/GlobalUI.js b/rpg-docs/client/globalHelpers/GlobalUI.js index aa4dc2b2..ad50010a 100644 --- a/rpg-docs/client/globalHelpers/GlobalUI.js +++ b/rpg-docs/client/globalHelpers/GlobalUI.js @@ -77,10 +77,10 @@ this.GlobalUI = (function() { var throttleBack = _.throttle(function() { history.back(); - }, 800, {trailing: false}); + }, 100, {trailing: false}); GlobalUI.closeDetail = function() { - if (!!(window.history && window.history.pushState)) { + if (window.history && history.pushState && history.state.detail === "opened") { throttleBack(); } else { Session.set("global.ui.detailShow", false);