Skip to content

Commit

Permalink
Fix spinners when adding event from routes other than /events
Browse files Browse the repository at this point in the history
  • Loading branch information
javfg committed Aug 20, 2021
1 parent e62e533 commit e447847
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
6 changes: 2 additions & 4 deletions www/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,8 @@ animation-delay: -0.15s;
color: #888;
}

#events-empty-spinner-container,
#events-spinner-container,
#registrant-spinner-container,
#registrants-spinner-container {
#empty-spinner-container,
#spinner-container {
display: block;
position: relative;
height: 1.4em;
Expand Down
2 changes: 1 addition & 1 deletion www/js/controllers/registrantController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ angular.module('Checkinapp.registrantController', []).controller('RegistrantCont
function ($scope, $location, Storage, IndicoApi) {
const spinner = new Spinner({lines: 8, length: 4, width: 3, radius: 3, color: '#464646', speed: 0.7}).spin();
$scope.loading = true;
document.getElementById('registrant-spinner-container').appendChild(spinner.el);
document.getElementById('spinner-container').appendChild(spinner.el);

async function doCheckin(server, eventId, registrantId, value = true) {
let result = await IndicoApi.doCheckin(server, eventId, registrantId, value);
Expand Down
2 changes: 1 addition & 1 deletion www/js/controllers/registrantsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ angular.module('Checkinapp.registrantsController', []).controller('RegistrantsCo
const spinner = new Spinner({lines: 8, length: 4, width: 3, radius: 3, color: '#464646', speed: 0.7}).spin();
$scope.loading = true;

document.getElementById('registrants-spinner-container').appendChild(spinner.el);
document.getElementById('spinner-container').appendChild(spinner.el);

try {
let result = await IndicoApi.getRegistrants(server, eventId);
Expand Down
4 changes: 2 additions & 2 deletions www/partials/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ <h3>
<div>No events</div>
<small>Please click in 'Add event' if you want to start the check-in process</small>
</h3>
<div ng-show="loading" id="events-empty-spinner-container" class="spinner-center"></div>
<div ng-show="loading" id="empty-spinner-container" class="spinner-center"></div>
</div>
<div ng-hide="isEventListEmpty()" class="panel panel-default">
<div class="panel-heading">
<div ng-show="loading" id="events-spinner-container" class="pull-right"></div>
<div ng-show="loading" id="spinner-container" class="pull-right"></div>
<div ng-hide="loading" class="pull-right">
<button type="button" class="btn btn-primary btn-sm" ng-click="editMode=true" ng-show="!editMode">
<span class="glyphicon glyphicon-edit"></span>
Expand Down
2 changes: 1 addition & 1 deletion www/partials/registrant.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<div ng-show="loading" id="registrant-spinner-container" class="pull-right"></div>
<div ng-show="loading" id="spinner-container" class="pull-right"></div>
<div ng-show="registrant.full_name">{{registrant.full_name}}</div>
<div ng-show="!registrant.full_name">Attendee</div>
<small>
Expand Down
3 changes: 2 additions & 1 deletion www/partials/registrants.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<h3>
<div>No attendees</div>
</h3>
<div ng-show="loading" id="empty-spinner-container" class="spinner-center"></div>
</div>
<div ng-hide="isRegistrantListEmpty()" id="registrants-list-container" class="panel panel-default">
<div class="panel-heading">
<div ng-show="loading" id="registrants-spinner-container" class="pull-right"></div>
<div ng-show="loading" id="spinner-container" class="pull-right"></div>
<div ng-hide="loading" class="pull-right badge bg-blue">{{totalCount}}</div>
<h3 class="panel-title">Attendees</h3>
</div>
Expand Down

0 comments on commit e447847

Please sign in to comment.