Skip to content

Commit

Permalink
Enabling dragging hotkey on contest start
Browse files Browse the repository at this point in the history
  • Loading branch information
ThunderStruct committed Dec 18, 2017
1 parent 01085af commit 86f9030
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ $(document).ready(function() {
if (!$('#loadContestBtn').hasClass('disabled'))
$('#loadContestBtn').addClass('disabled');

// enable contest dragging hotkey
$('#draggingHotkeyElement').removeClass('disabled');

// on page unload listener
window.onbeforeunload = function() {
return 'The current contest will be lost...';
Expand Down
4 changes: 3 additions & 1 deletion js/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,9 @@ function getSubmissionDetails() {
for (var i = 0; i < filteredData.problems.length; i += 1) {
var problem = filteredData.problems[i];
var problemDayDate = moment((new Date(problem.submissionTime))).format('dddd, MMMM Do YYYY');
var dataIdx = filteredData.data.findIndex(row => row.Date == problemDayDate);
var dataIdx = filteredData.data.findIndex(function(row) {
return row.Date == problemDayDate;
});
if (dataIdx === -1) {
// create data entry
filteredData.data.push({'Date': problemDayDate, 'Total Submissions': 1, 'Total Correct Submissions': problem.verdict == 'OK' ? 1 : 0});
Expand Down

0 comments on commit 86f9030

Please sign in to comment.