Commit fb589815 authored by Ioannis Tsafaras's avatar Ioannis Tsafaras
Browse files

Add tooltip to upload application disabled submit button

parent 2705b40b
......@@ -4,6 +4,7 @@ var UploadController = Ember.Controller.extend({
session: Ember.inject.service('session'),
wrongExt: false,
userHasEnteredData: false,
submitDisabled: false,
actions : {
upload: function() {
......@@ -53,6 +54,7 @@ var UploadController = Ember.Controller.extend({
var xhr = new window.XMLHttpRequest();
_this.set("userHasEnteredData", true);
submit_button.setAttribute("disabled", "disabled");
_this.set("submitDisabled", true);
//Upload progress
xhr.upload.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
......@@ -62,6 +64,7 @@ var UploadController = Ember.Controller.extend({
if (percentComplete === 1)
{
submit_button.removeAttribute("disabled");
_this.set("submitDisabled", false);
_this.set("userHasEnteredData", false);
}
}
......
......@@ -125,7 +125,15 @@
</div><!--col-->
</div><!--row-->
{{#unless submitDisabled}}
<button type="submit" class="btn btn-primary" id="submit-button">Submit</button>
{{else}}
{{#tool-tip}}
<button type="submit" class="btn btn-primary has-tooltip"
data-tooltip-content="<center>An application is already uploading!</center>"
id="submit-button">Submit</button>
{{/tool-tip}}
{{/unless}}
</form>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment