Skip to content

Commit

Permalink
Merge pull request #1806 from akvo/issue/1791-amusing
Browse files Browse the repository at this point in the history
[#1791] use setTimeout so save clicks propagate
  • Loading branch information
KasperBrandt committed Sep 17, 2015
2 parents 3284816 + 591db08 commit 98b8891
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion akvo/rsr/static/scripts-src/myrsr-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,7 @@ function setValidationListeners() {
function getHideCharsListener(el) {
var parent = el.parentNode;
var output;
var outputTimeout;

output = function() {
var charsLeft = parent.querySelector('.charsLeft');
Expand All @@ -1654,7 +1655,11 @@ function setValidationListeners() {
}
};

return output;
outputTimeout = function() {
setTimeout(output, 250);
};

return outputTimeout;
}

// Mark mandatory fields with an asterisk
Expand Down
7 changes: 6 additions & 1 deletion akvo/rsr/static/scripts-src/myrsr-admin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,7 @@ function setValidationListeners() {
function getHideCharsListener(el) {
var parent = el.parentNode;
var output;
var outputTimeout;

output = function() {
var charsLeft = parent.querySelector('.charsLeft');
Expand All @@ -1654,7 +1655,11 @@ function setValidationListeners() {
}
};

return output;
outputTimeout = function() {
setTimeout(output, 250);
};

return outputTimeout;
}

// Mark mandatory fields with an asterisk
Expand Down

0 comments on commit 98b8891

Please sign in to comment.