Skip to content

Commit

Permalink
Ensure pending timeouts are cleared before performing a gridfield rel…
Browse files Browse the repository at this point in the history
…oad.

Fixed button spacing via CSS.
  • Loading branch information
bummzack committed May 25, 2016
1 parent 26c5fd2 commit c3074db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions css/omnipay-ui-cms.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
}

.cms .gridfield-button-capture .ui-button-text,
.cms .gridfield-button-capture .ui-button-text,
.cms .gridfield-button-capture .ui-button-text
.cms .gridfield-button-refund .ui-button-text,
.cms .gridfield-button-void .ui-button-text
{
padding-left: 1em;
padding-right: 1em;
Expand Down
7 changes: 7 additions & 0 deletions javascript/omnipay-ui-cms.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
this._super();
},

reload: function(ajaxOpts, successCallback) {
// clear any running timeout before reloading
this._clearTimeout();
this._super(ajaxOpts, successCallback);
},

onreload: function () {
this._super();
this.refreshPendingPayments(2000);
Expand Down Expand Up @@ -122,6 +128,7 @@
_clearTimeout: function () {
if (this.data("payment-timeout")) {
window.clearTimeout(this.data("payment-timeout"));
this.data("payment-timeout", null);
}
}
});
Expand Down

0 comments on commit c3074db

Please sign in to comment.