Skip to content

Commit 13689c7

Browse files
author
Kacper Warda
committedNov 16, 2017
GS-91: Changing Pivot Report preloader displaying.
1 parent e1a2a77 commit 13689c7

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed
 

‎css/style.css

+6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ div.pivot-report-output-config div.pivot-report-export-button {
154154
transition: none;
155155
}
156156

157+
#pivot-report-preloader .progress .progress-value {
158+
position: absolute;
159+
width: 100%;
160+
text-align: center;
161+
}
162+
157163
div.right-align {
158164
float: right;
159165
}

‎css/style_admin.css

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/* Pivot Report cache rebuilding */
2+
3+
div.rebuild-pivot-report-cache div.in-progress {
4+
display: inline;
5+
}
6+
7+
div.rebuild-pivot-report-cache div.in-progress i.fa-spin {
8+
font-size: 1.5em;
9+
vertical-align: middle;
10+
}
11+
112
/* Pivot Table progress bar */
213

314
#pivot-report-preloader {
@@ -12,6 +23,12 @@
1223
transition: none;
1324
}
1425

26+
#pivot-report-preloader .progress .progress-value {
27+
position: absolute;
28+
width: 100%;
29+
text-align: center;
30+
}
31+
1532
#pivot-report-admin .build-date-time {
1633
margin-top: 1em;
1734
}

‎js/PivotReport.Admin.js

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ CRM.PivotReport.Admin = (function($) {
8080
that.Preloader.hide();
8181
that.updateBuildDateTime();
8282

83+
$('input.build-cache-button', that.container).prop('disabled', false);
84+
8385
CRM.alert('All Pivot Reports have been refreshed.', null, 'success');
8486
}
8587

@@ -130,6 +132,8 @@ CRM.PivotReport.Admin = (function($) {
130132
$('input[type="button"].build-cache-button').click(function(e) {
131133
CRM.confirm({message: 'This operation may take some time to build the cache. Do you really want to build the cache for all supported entities?' })
132134
.on('crmConfirm:yes', function() {
135+
$('input.build-cache-button', that.container).prop('disabled', true);
136+
133137
that.buildCache();
134138
});
135139
});

‎js/PivotReport.Preloader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CRM.PivotReport.Preloader = (function($) {
99
this.container = CRM.$('#pivot-report-preloader');
1010
this.title = CRM.$('.pivot-report-loading-title', this.container);
1111
this.progressBar = CRM.$('.progress > .progress-bar', this.container);
12+
this.progressValue = CRM.$('.progress > .progress-value', this.container);
1213
}
1314

1415
/**
@@ -49,9 +50,8 @@ CRM.PivotReport.Preloader = (function($) {
4950
Preloader.prototype.setValue = function(value) {
5051
var progressValue = value + '%';
5152

52-
this.progressBar.attr('aria-valuenow', progressValue);
5353
this.progressBar.css('width', progressValue);
54-
this.progressBar.text(progressValue);
54+
this.progressValue.text(progressValue);
5555
}
5656

5757
return Preloader;

‎templates/CRM/PivotReport/Page/ReportPreloader.tpl

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<div class="pivot-report-loading-title"></div>
33
<div class="progress">
44
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
5+
<div class="progress-value"></div>
56
</div>
67
</div>

0 commit comments

Comments
 (0)
Please sign in to comment.