Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
Rebuilding animation now works whehter just rebuilding or pushing new…
Browse files Browse the repository at this point in the history
… files.
  • Loading branch information
cantrell committed Sep 18, 2012
1 parent c12e5ca commit bfdde14
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.js
Expand Up @@ -192,6 +192,7 @@ define(function (require, exports, module) {
xhr.addEventListener("loadend", function (ev) { // Success or failure
console.log("load", this, ev);
$("#pgb-progress-" + id).css("visibility", "hidden");
toggleRebuildLabels(id);
eve("pgb.success.status", null, JSON.parse(this.responseText));
}, false);
xhr.upload.addEventListener("error", function (ev) {
Expand Down Expand Up @@ -276,6 +277,11 @@ define(function (require, exports, module) {
$alert.fadeIn("fast");
}

function toggleRebuildLabels(id) {
$("#rebuild-link-" + id).toggle();
$("#rebuilding-text-" + id).toggle();
}

eve.on("pgb.status", function () {
var type = eve.nt().split(/[\.\/]/)[2];
button[0].className = type;
Expand Down Expand Up @@ -441,8 +447,7 @@ define(function (require, exports, module) {
});
eve.on("pgb.rebuild", function (id) {
console.log("pgb.rebuild", id);
$("#rebuild-link-" + id).hide();
$("#rebuilding-text-" + id).show();
toggleRebuildLabels(id);
ajax("api/v1/apps/" + id, "rebuild", "put");
});
eve.on("pgb.error.rebuild", function (error) {
Expand Down Expand Up @@ -504,9 +509,7 @@ define(function (require, exports, module) {
$("#pgb-app-" + os + "-" + json.id).attr("class", "icon " + os + "-" + status);
}
if (finished) {
$("#rebuild-link-" + json.id).show();
$("#rebuilding-text-" + json.id).html(Strings.REBUILDING_MESSAGE);
$("#rebuilding-text-" + json.id).hide();
toggleRebuildLabels(json.id);
showAlert(Strings.REBUILT_SUCCESS_MESSAGE, false, null, true);
} else {
var $rebuildingMsg = $("#rebuilding-text-" + json.id).html();
Expand Down

0 comments on commit bfdde14

Please sign in to comment.