##// 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 min-width: 600px;
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 // Keyboard mappings
387 // Keyboard mappings
377 table.keyboard-mappings {
388 table.keyboard-mappings {
378 th {
389 th {
@@ -14,32 +14,50 b''
14 <div class="title">
14 <div class="title">
15
15
16 </div>
16 </div>
17
17 <!-- end box / title -->
18 <!-- end box / title -->
18 <div id="no_grid_data" class="table" style="display: none">
19 <div id="no_grid_data" class="table" style="display: none">
19 <h2 class="no-object-border">
20 <h2>
20 ${_('No repositories or repositories groups exists here.')}
21 ${_('No repositories or repositories groups exists here.')}
21 </h2>
22 </h2>
22 </div>
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 <div class="table">
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 <table id="group_list_table" class="display" style="width: 100%;"></table>
32 <table id="group_list_table" class="display" style="width: 100%;"></table>
27 </div>
33 </div>
28 </div>
34 </div>
29
35
30 <div class="table">
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 <table id="repo_list_table" class="display" style="width: 100%;"></table>
38 <table id="repo_list_table" class="display" style="width: 100%;"></table>
33 </div>
39 </div>
34 </div>
40 </div>
35
41
36 </div>
42 </div>
43
37 <script>
44 <script>
38 $(document).ready(function () {
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 var $groupListTable = $('#group_list_table');
56 var $groupListTable = $('#group_list_table');
42
57
58 $groupListTable.on('xhr.dt', function (e, settings, json, xhr) {
59 $gridDataLoading.hide();
60 });
43 $groupListTable.DataTable({
61 $groupListTable.DataTable({
44 processing: true,
62 processing: true,
45 serverSide: true,
63 serverSide: true,
@@ -97,11 +115,12 b''
97 emptyTable: _gettext("No repository groups present.")
115 emptyTable: _gettext("No repository groups present.")
98 },
116 },
99 "drawCallback": function (settings, json) {
117 "drawCallback": function (settings, json) {
118
100 // hide grid if it's empty
119 // hide grid if it's empty
101 if (settings.fnRecordsDisplay() === 0) {
120 if (settings.fnRecordsDisplay() === 0) {
102 $('#groups_list_wrap').hide();
121 noGroupData = true;
103 // both hidden, show no-data
122 // both hidden, show no-data
104 if ($('#repos_list_wrap').is(':hidden')) {
123 if (noRepoData === true) {
105 $('#no_grid_data').show();
124 $('#no_grid_data').show();
106 }
125 }
107 } else {
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) {
142 ## repo list
127 $groupListTable.css('opacity', 0.3);
128 });
129
130
131 ## // repo list
132 var $repoListTable = $('#repo_list_table');
143 var $repoListTable = $('#repo_list_table');
133
144
145 $repoListTable.on('xhr.dt', function (e, settings, json, xhr) {
146 $gridDataLoading.hide();
147 });
134 $repoListTable.DataTable({
148 $repoListTable.DataTable({
135 processing: true,
149 processing: true,
136 serverSide: true,
150 serverSide: true,
@@ -188,11 +202,13 b''
188 emptyTable: _gettext("No repositories present.")
202 emptyTable: _gettext("No repositories present.")
189 },
203 },
190 "drawCallback": function (settings, json) {
204 "drawCallback": function (settings, json) {
205
191 // hide grid if it's empty
206 // hide grid if it's empty
192 if (settings.fnRecordsDisplay() == 0) {
207 if (settings.fnRecordsDisplay() == 0) {
193 $('#repos_list_wrap').hide()
208 noRepoData = true;
209
194 // both hidden, show no-data
210 // both hidden, show no-data
195 if ($('#groups_list_wrap').is(':hidden')) {
211 if (noGroupData === true) {
196 $('#no_grid_data').show()
212 $('#no_grid_data').show()
197 }
213 }
198 } else {
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 </script>
230 </script>
223 </%def>
231 </%def>
General Comments 0
You need to be logged in to leave comments. Login now