Skip to content

Commit

Permalink
Resolves issue #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
Beerend Lauwers committed Aug 7, 2016
1 parent c507138 commit 9f89e44
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/css/ui/submit/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ button.preview {
font-style: italic;
}

#new-submit-request-button,
#confirmed,
#confirm {
display: none;
Expand Down
9 changes: 9 additions & 0 deletions app/js/pull-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ function collectDataAndSubmitPullRequest(templateName,titleSelector) {
submitHaskAnythingPullRequest( userToken, userName, data, writeToHtmlArea );
}

function onPullRequestSuccessful() {
// Disable the pull request button.
jQuery('#submit-pull-request-button').prop('disabled','disabled');

// Make the "want to submit again?" button visible.
jQuery('#new-submit-request-button').show();
}

function naiveHash(str) {
var hash = 0, i, chr, len;
if (str.length === 0) return hash;
Expand Down Expand Up @@ -153,6 +161,7 @@ function submitHaskAnythingPullRequest( userToken, userName, data, logWriter ) {
else {
logWriter("Pull request \"" + pull.title + "\" created.");
logWriter("Done!");
onPullRequestSuccessful();
}
});
}
Expand Down
6 changes: 6 additions & 0 deletions app/ui/elements/submit-pull-request.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@
<span class="feedback-github">Diagnostic information about the connection with Github will appear here.<span>
<textarea readonly id="submit-pull-request-feedback"/>
</div>
</div>

<div class="row col-sm-12">
<div class="col-sm-12">
<button type="button" id="new-submit-request-button" onclick="location.reload();">Submit another $handlebar-template$ ?</button>
</div>
</div>

0 comments on commit 9f89e44

Please sign in to comment.