Skip to content

Commit

Permalink
Add a waiting icon while the mail is sent. re #53
Browse files Browse the repository at this point in the history
  • Loading branch information
seblucas committed Jul 22, 2013
1 parent 3ed5685 commit fc8c510
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/default/bookdetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2 class="download">
{{~it.book.datas:data:i}}
<a href="{{=data.url}}">{{=data.format}}</a>
{{? 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 />
{{~}}
Expand Down
2 changes: 2 additions & 0 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function elapsed () {
}

function retourMail(data, textStatus, jqXHR ) {
$("#mailButton :first-child").removeClass ("icon-spinner icon-spin").addClass ("icon-envelope");
alert (data);
}

Expand All @@ -64,6 +65,7 @@ function sendToMailAddress (component, dataid) {
if (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});
}

Expand Down

0 comments on commit fc8c510

Please sign in to comment.