Skip to content

Commit

Permalink
Visually indicate Force Pull from live entry screen when shift key is…
Browse files Browse the repository at this point in the history
… down.
  • Loading branch information
moveson committed Feb 19, 2018
1 parent 30a2495 commit 1eb1bf6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
19 changes: 16 additions & 3 deletions app/assets/javascripts/group_live_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
} else {
$('#js-group-new-times-alert').fadeTo(500, 0, function() {$('#js-group-new-times-alert').hide()});
}
$('#js-group-pull-times-count').text(text);
$('#js-pull-times-count').text(text);
}
},

Expand Down Expand Up @@ -999,13 +999,26 @@
liveEntry.timeRowsTable.busy = false;
}
});
$('#js-group-import-live-times').on('click', function (event) {

$(document).on('keydown', function (event) {
if(event.keyCode === 16) {
$('#js-import-live-times').hide();
$('#js-force-import-live-times').show()
}
});
$(document).on('keyup', function (event) {
if(event.keyCode === 16) {
$('#js-force-import-live-times').hide();
$('#js-import-live-times').show()
}
});
$('#js-import-live-times, #js-force-import-live-times').on('click', function (event) {
event.preventDefault();
if (liveEntry.importAsyncBusy) {
return;
}
liveEntry.importAsyncBusy = true;
var forceParam = (event.shiftKey) ? '?forcePull=true' : '';
var forceParam = (this.id === 'js-import-live-times') ? '?forcePull=true' : '';
$.ajax('/api/v1/event_groups/' + liveEntry.currentEventGroupId + '/pull_live_time_rows' + forceParam, {
error: function(obj, error) {
liveEntry.importAsyncBusy = false;
Expand Down
18 changes: 10 additions & 8 deletions app/views/live/event_groups/live_entry.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="row header">
<div id="js-group-new-times-alert" class="alert alert-info center" role="alert">
<a href="#js-group-import-live-times">New Live Times availale</a>
<a href="#js-import-live-times">New Live Times available</a>
</div>
<div class="col-xs-12 col-md-6 page-title">
<h2></h2>
Expand Down Expand Up @@ -205,13 +205,15 @@
</div>
</div>
<div class="row provisional-data">
<div class="col-xs-12 table-submit-wrapper">
<div class="btn-group" role="group">
<button id="js-group-import-live-times" class="btn btn-primary">
Pull Times
<span class="badge" id="js-group-pull-times-count"></span>
</button>
</div>
<div id="js-table-submit-buttons" class="col-xs-12 table-submit-wrapper">
<button id="js-import-live-times" class="btn btn-primary">
Pull Times
<span class="badge" id="js-pull-times-count"></span>
</button>
<button id="js-force-import-live-times" class="btn btn-danger" style="display: none;">
Force Pull
<span class="badge" id="js-force-pull-times-count"></span>
</button>
<div class="btn-group" role="group">
<button id="js-group-file-split" class="btn btn-primary" disabled></button>
<button class="btn btn-primary fileinput-button">
Expand Down
Binary file modified erd.pdf
Binary file not shown.

0 comments on commit 1eb1bf6

Please sign in to comment.