From 5a0951bf5bbea162c6c89f3928991b0a7e741624 Mon Sep 17 00:00:00 2001 From: Thomas Rueckstiess Date: Thu, 3 Nov 2016 17:58:34 +1100 Subject: [PATCH 1/2] COMPASS-144 call stopPropagation() when cancel clicked otherwise the event bubbles up to the top and causes the page to reload, which takes the user back to the instance level. --- src/auto-update/index.jade | 6 +++--- src/auto-update/index.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/auto-update/index.jade b/src/auto-update/index.jade index 99e5bae6280..ebdaf578001 100644 --- a/src/auto-update/index.jade +++ b/src/auto-update/index.jade @@ -1,6 +1,6 @@ #auto-update .btn-group.pull-right - a.btn.btn-primary(data-hook='cancel') Not now - a.btn.btn-primary(data-hook='confirm') Yes please - + a.btn.btn-primary(data-hook='cancel', href='#') Not now + a.btn.btn-primary(data-hook='confirm', href='#') Yes please + p A newer version of Compass is now available! Would you like to install it and restart Compass? diff --git a/src/auto-update/index.js b/src/auto-update/index.js index 337b561d8f9..ec5fb5db6b8 100644 --- a/src/auto-update/index.js +++ b/src/auto-update/index.js @@ -58,7 +58,8 @@ var NotificationUpdateAvailable = View.extend({ } }); }, - cancel: function() { + cancel: function(evt) { + evt.stopPropagation(); this.visible = false; return false; }, From c0c1b85790d951f8e74bd9e336dfc9b2dfe03233 Mon Sep 17 00:00:00 2001 From: Thomas Rueckstiess Date: Thu, 3 Nov 2016 18:10:29 +1100 Subject: [PATCH 2/2] =?UTF-8?q?switch=20to=20preventDefault()=20because=20?= =?UTF-8?q?it=E2=80=99s=20less=20invasive.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auto-update/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auto-update/index.js b/src/auto-update/index.js index ec5fb5db6b8..0ce489120ea 100644 --- a/src/auto-update/index.js +++ b/src/auto-update/index.js @@ -59,7 +59,7 @@ var NotificationUpdateAvailable = View.extend({ }); }, cancel: function(evt) { - evt.stopPropagation(); + evt.preventDefault(); this.visible = false; return false; },