Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit 9d7dc04

Browse files
committed
Merge pull request #424 from allenwq/bugfixing/dup-submissions
Disable mission attempt button after clicking for the first time
2 parents 46eff43 + 33594a8 commit 9d7dc04

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/assets/javascripts/assignments.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ $(document).ready(function() {
2525
klass = 'btn-success';
2626
break;
2727
}
28-
$div.html('<a href="' + actions_map[mid].url + '" class="btn ' + klass + '" >' + actions_map[mid].action + '</a>')
28+
var link = $('<a>', {
29+
'href': actions_map[mid].url,
30+
'class': 'btn ' + klass,
31+
'text': actions_map[mid].action
32+
}).appendTo($div);
33+
if ( actions_map[mid].action == 'Attempt' ){
34+
link.attr('data-disable-with', 'Attempting...');
35+
}
2936
}
3037
var $title = $("#title-"+mid);
3138
if ($title.length > 0) {
@@ -61,4 +68,4 @@ $(document).ready(function() {
6168
console.log(e);
6269
}
6370
}
64-
});
71+
});

0 commit comments

Comments
 (0)