##// END OF EJS Templates
main-page: fixed jumping of text in grid loading....
dan -
r4185:d325c1c9 stable
parent child Browse files
Show More
@@ -373,6 +373,17 b' table#repo_list_table {'
373 373 min-width: 600px;
374 374 }
375 375
376 #no_grid_data {
377 text-align: center;
378 }
379
380 #grid_data_loading {
381 text-align: center;
382 font-weight: 600;
383 font-size: 16px;
384 padding: 80px 20px;
385 }
386
376 387 // Keyboard mappings
377 388 table.keyboard-mappings {
378 389 th {
@@ -14,32 +14,50 b''
14 14 <div class="title">
15 15
16 16 </div>
17
17 18 <!-- end box / title -->
18 19 <div id="no_grid_data" class="table" style="display: none">
19 <h2 class="no-object-border">
20 <h2>
20 21 ${_('No repositories or repositories groups exists here.')}
21 22 </h2>
22 23 </div>
23 24
25 <div id="grid_data_loading" class="table" style="display: none">
26 <i class="icon-spin animate-spin"></i>
27 ${_('loading...')}
28 </div>
29
24 30 <div class="table">
25 <div id="groups_list_wrap" style="min-height: 200px;">
31 <div id="groups_list_wrap" style="min-height: 200px;display: none">
26 32 <table id="group_list_table" class="display" style="width: 100%;"></table>
27 33 </div>
28 34 </div>
29 35
30 36 <div class="table">
31 <div id="repos_list_wrap" style="min-height: 200px;">
37 <div id="repos_list_wrap" style="min-height: 200px;display: none">
32 38 <table id="repo_list_table" class="display" style="width: 100%;"></table>
33 39 </div>
34 40 </div>
35 41
36 42 </div>
43
37 44 <script>
38 45 $(document).ready(function () {
46 var noRepoData = null;
47 var noGroupData = null;
48 var $gridDataLoading = $('#grid_data_loading');
39 49
40 // repo group list
50 // global show loading of hidden grids
51 $(document).on('preInit.dt', function (e, settings) {
52 $gridDataLoading.show();
53 });
54
55 ## repo group list
41 56 var $groupListTable = $('#group_list_table');
42 57
58 $groupListTable.on('xhr.dt', function (e, settings, json, xhr) {
59 $gridDataLoading.hide();
60 });
43 61 $groupListTable.DataTable({
44 62 processing: true,
45 63 serverSide: true,
@@ -97,11 +115,12 b''
97 115 emptyTable: _gettext("No repository groups present.")
98 116 },
99 117 "drawCallback": function (settings, json) {
118
100 119 // hide grid if it's empty
101 120 if (settings.fnRecordsDisplay() === 0) {
102 $('#groups_list_wrap').hide();
121 noGroupData = true;
103 122 // both hidden, show no-data
104 if ($('#repos_list_wrap').is(':hidden')) {
123 if (noRepoData === true) {
105 124 $('#no_grid_data').show();
106 125 }
107 126 } else {
@@ -119,18 +138,13 b''
119 138 },
120 139 });
121 140
122 $groupListTable.on('xhr.dt', function (e, settings, json, xhr) {
123 $groupListTable.css('opacity', 1);
124 });
125 141
126 $groupListTable.on('preXhr.dt', function (e, settings, data) {
127 $groupListTable.css('opacity', 0.3);
128 });
129
130
131 ## // repo list
142 ## repo list
132 143 var $repoListTable = $('#repo_list_table');
133 144
145 $repoListTable.on('xhr.dt', function (e, settings, json, xhr) {
146 $gridDataLoading.hide();
147 });
134 148 $repoListTable.DataTable({
135 149 processing: true,
136 150 serverSide: true,
@@ -188,11 +202,13 b''
188 202 emptyTable: _gettext("No repositories present.")
189 203 },
190 204 "drawCallback": function (settings, json) {
205
191 206 // hide grid if it's empty
192 207 if (settings.fnRecordsDisplay() == 0) {
193 $('#repos_list_wrap').hide()
208 noRepoData = true;
209
194 210 // both hidden, show no-data
195 if ($('#groups_list_wrap').is(':hidden')) {
211 if (noGroupData === true) {
196 212 $('#no_grid_data').show()
197 213 }
198 214 } else {
@@ -210,14 +226,6 b''
210 226 },
211 227 });
212 228
213 $repoListTable.on('xhr.dt', function (e, settings, json, xhr) {
214 $repoListTable.css('opacity', 1);
215 });
216
217 $repoListTable.on('preXhr.dt', function (e, settings, data) {
218 $repoListTable.css('opacity', 0.3);
219 });
220
221 229 });
222 230 </script>
223 231 </%def>
General Comments 0
You need to be logged in to leave comments. Login now