Add a waiting icon while the mail is sent. re #53

This commit is contained in:
Sébastien Lucas 2013-07-22 21:27:32 +02:00
parent 3ed5685f12
commit fc8c510ae4
2 changed files with 3 additions and 1 deletions

View file

@ -10,7 +10,7 @@
{{~it.book.datas:data:i}} {{~it.book.datas:data:i}}
<a href="{{=data.url}}">{{=data.format}}</a> <a href="{{=data.url}}">{{=data.format}}</a>
{{? data.mail == 1}} {{? data.mail == 1}}
<a title="Mail" href="empty.php" onclick="sendToMailAddress (this, {{=data.id}}); return false;"><i class="icon-envelope icon-large"></i></a> <a id="mailButton" title="Mail" href="empty.php" onclick="sendToMailAddress (this, {{=data.id}}); return false;"><i class="icon-envelope icon-large"></i></a>
{{?}} {{?}}
<br /> <br />
{{~}} {{~}}

View file

@ -51,6 +51,7 @@ function elapsed () {
} }
function retourMail(data, textStatus, jqXHR ) { function retourMail(data, textStatus, jqXHR ) {
$("#mailButton :first-child").removeClass ("icon-spinner icon-spin").addClass ("icon-envelope");
alert (data); alert (data);
} }
@ -64,6 +65,7 @@ function sendToMailAddress (component, dataid) {
if (currentData.databaseId) { if (currentData.databaseId) {
url = url + '?db=' + currentData.databaseId; url = url + '?db=' + currentData.databaseId;
} }
$("#mailButton :first-child").removeClass ("icon-envelope").addClass ("icon-spinner icon-spin");
$.ajax ({'url': url, 'type': 'post', 'data': { 'data': dataid, 'email': email }, 'success': retourMail}); $.ajax ({'url': url, 'type': 'post', 'data': { 'data': dataid, 'email': email }, 'success': retourMail});
} }