couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [2/2] fauxton commit: updated refs/heads/master to 17cfa63
Date Tue, 20 Jan 2015 09:18:21 GMT
Don't redirect on dismissing the notification

If you edited a document and then clicked on cancel, you were
redirected to the database list

closes COUCHDB-2550


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/b872ebfa
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/b872ebfa
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/b872ebfa

Branch: refs/heads/master
Commit: b872ebfa4adfc2c8a9d0643150d3404f9713ab0e
Parents: 2a7fc64
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Mon Jan 19 11:51:52 2015 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Tue Jan 20 10:17:55 2015 +0100

----------------------------------------------------------------------
 app/addons/fauxton/base.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b872ebfa/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index 316ec55..f575ed2 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -106,7 +106,7 @@ function(app, FauxtonAPI, Components, ReactComponents, Actions, ZeroClipboard)
{
     animationTimer: 5000,
 
     events: {
-      'click .js-dismiss': 'removeWithAnimation'
+      'click .js-dismiss': 'onClickRemoveWithAnimation'
     },
 
     initialize: function(options) {
@@ -148,14 +148,20 @@ function(app, FauxtonAPI, Components, ReactComponents, Actions, ZeroClipboard)
{
       };
     },
 
-    removeWithAnimation: function () {
+    onClickRemoveWithAnimation: function (event) {
+      event.preventDefault();
+      window.clearTimeout(this.timeout);
+      this.removeWithAnimation();
+    },
+
+    removeWithAnimation: function (event) {
       this.$el.velocity('reverse', FauxtonAPI.constants.MISC.TRAY_TOGGLE_SPEED, function
() {
         this.$el.remove();
       }.bind(this));
     },
 
     delayedRemoval: function () {
-      setTimeout(function () {
+      this.timeout = setTimeout(function () {
         this.removeWithAnimation();
       }.bind(this), this.animationTimer);
     },


Mime
View raw message