Skip to content

Commit

Permalink
Merge pull request #37 from poradz/2019/9/13/1
Browse files Browse the repository at this point in the history
Disabled multiple click on import button
  • Loading branch information
mariuszkrzaczkowski authored Sep 13, 2019
2 parents b0acd3d + d869369 commit 7dd9cca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
21 changes: 14 additions & 7 deletions plugins/yetiforce/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ function registerEvents(content) {
}

function registerImportMail(content) {
content.find('.importMail').click(function (e) {
let clicked = false;
content.find('.importMail').click(function(e) {
if (clicked) return false;
clicked = true;
window.crm.Vtiger_Helper_Js.showPnotify({
text: window.crm.app.vtranslate('StartedDownloadingEmail'),
type: 'info'
Expand All @@ -73,13 +76,17 @@ function registerImportMail(content) {
uid: rcmail.env.uid,
folder: rcmail.env.mailbox,
rcId: rcmail.env.user_id
}).done(function (data) {
loadActionBar();
window.crm.Vtiger_Helper_Js.showPnotify({
text: window.crm.app.vtranslate('AddFindEmailInRecord'),
type: 'success'
});
})
.done(function(data) {
loadActionBar();
window.crm.Vtiger_Helper_Js.showPnotify({
text: window.crm.app.vtranslate('AddFindEmailInRecord'),
type: 'success'
});
})
.fail(function() {
clicked = false;
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/yetiforce/preview.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7dd9cca

Please sign in to comment.