|
53 | 53 | exit(); |
54 | 54 | case 'copy': |
55 | 55 | $result = SessionManager::copy( |
56 | | - (int) $idChecked, |
57 | | - true, |
58 | | - true, |
59 | | - false, |
60 | | - false, |
61 | | - $copySessionContent |
| 56 | + (int) $idChecked, |
| 57 | + true, |
| 58 | + true, |
| 59 | + false, |
| 60 | + false, |
| 61 | + $copySessionContent |
62 | 62 | ); |
63 | 63 | if ($result) { |
64 | 64 | Display::addFlash(Display::return_message(get_lang('Item copied'))); |
|
138 | 138 | #session-table .ui-jqgrid { |
139 | 139 | max-width: 100%; |
140 | 140 | } |
| 141 | +#session-table.sessions-grid-wrap .ui-jqgrid tr.jqgrow, |
| 142 | +#session-table.sessions-grid-wrap .ui-jqgrid tr.jqgrow td { |
| 143 | + height: auto !important; |
| 144 | +} |
| 145 | +#session-table.sessions-grid-wrap .ui-jqgrid tr.jqgrow td { |
| 146 | + white-space: normal !important; |
| 147 | + line-height: 1.25 !important; |
| 148 | + padding-top: 6px !important; |
| 149 | + padding-bottom: 6px !important; |
| 150 | + vertical-align: top !important; |
| 151 | + overflow: visible !important; |
| 152 | + text-overflow: clip !important; |
| 153 | + word-break: break-word; |
| 154 | + overflow-wrap: anywhere; |
| 155 | +} |
| 156 | +#session-table.sessions-grid-wrap .ui-jqgrid-htable th div { |
| 157 | + white-space: normal !important; |
| 158 | + height: auto !important; |
| 159 | + line-height: 1.2 !important; |
| 160 | +} |
| 161 | +#session-table.sessions-grid-wrap .ui-jqgrid .ui-jqgrid-bdiv { |
| 162 | + overflow-x: auto !important; |
| 163 | +} |
| 164 | +#session-table #gbox_sessions, |
| 165 | +#session-table #gview_sessions, |
| 166 | +#session-table #gview_sessions .ui-jqgrid-hdiv, |
| 167 | +#session-table #gview_sessions .ui-jqgrid-bdiv, |
| 168 | +#session-table #gview_sessions .ui-jqgrid-pager { |
| 169 | + width: 100% !important; |
| 170 | +} |
141 | 171 | .sessions-advanced-search-float { |
142 | 172 | position: fixed !important; |
143 | 173 | z-index: 3000 !important; |
|
151 | 181 | .sessions-advanced-search-float .ui-jqgrid { |
152 | 182 | font-size: 13px; |
153 | 183 | } |
154 | | -#session-table #gbox_sessions, |
155 | | -#session-table #gview_sessions, |
156 | | -#session-table #gview_sessions .ui-jqgrid-hdiv, |
157 | | -#session-table #gview_sessions .ui-jqgrid-bdiv, |
158 | | -#session-table #gview_sessions .ui-jqgrid-pager { |
159 | | - width: 100% !important; |
160 | | -} |
161 | 184 | #sessions_pager .ui-pg-button.ui-state-hover .ch-tool-icon, |
162 | 185 | #sessions_pager .ui-pg-button:hover .ch-tool-icon, |
163 | 186 | #sessions_pager .ui-pg-button.ui-state-hover .mdi, |
|
249 | 272 | $column_model = $result['column_model']; |
250 | 273 | $extra_params['autowidth'] = 'true'; |
251 | 274 | $extra_params['height'] = 'auto'; |
252 | | -$extra_params['shrinkToFit'] = true; |
253 | | -$extra_params['forceFit'] = true; |
| 275 | +$extra_params['shrinkToFit'] = false; |
| 276 | +$extra_params['forceFit'] = false; |
254 | 277 |
|
255 | 278 | switch ($listType) { |
256 | 279 | case 'custom': |
@@ -346,7 +369,7 @@ function show_cols(grid, added_cols) { |
346 | 369 | $(elem).datetimepicker('setDate', next_month); |
347 | 370 | } |
348 | 371 |
|
349 | | - //Great hack |
| 372 | + // Great hack |
350 | 373 | register_second_select = function(elem) { |
351 | 374 | second_filters[$(elem).val()] = $(elem); |
352 | 375 | } |
@@ -391,18 +414,55 @@ function show_cols(grid, added_cols) { |
391 | 414 | setSearchSelect("status"); |
392 | 415 | var grid = $("#sessions"); |
393 | 416 |
|
394 | | - // Re-apply width after each data render (jqGrid sometimes resets widths) |
| 417 | + function resizeSessionsGrid() { |
| 418 | + var container = document.getElementById("session-table"); |
| 419 | + if (!container) { |
| 420 | + return; |
| 421 | + } |
| 422 | + |
| 423 | + var rect = container.getBoundingClientRect(); |
| 424 | + var newWidth = Math.floor(rect.width); |
| 425 | + |
| 426 | + // Avoid applying invalid widths (e.g. while hidden inside a tab) |
| 427 | + if (!newWidth || newWidth < 200) { |
| 428 | + return; |
| 429 | + } |
| 430 | + |
| 431 | + grid.jqGrid("setGridWidth", newWidth, true); |
| 432 | + } |
| 433 | + |
| 434 | + function applySessionsTooltips() { |
| 435 | + // Add a tooltip with full text to each simple cell (skip action/icon cells). |
| 436 | + var $cells = grid.closest("#gbox_sessions").find("tr.jqgrow td"); |
| 437 | + $cells.each(function() { |
| 438 | + var $td = $(this); |
| 439 | + if ($td.attr("title")) { |
| 440 | + return; |
| 441 | + } |
| 442 | + if ($td.find("a,button,svg,i").length) { |
| 443 | + return; |
| 444 | + } |
| 445 | + var text = $.trim($td.text()); |
| 446 | + if (text) { |
| 447 | + $td.attr("title", text); |
| 448 | + } |
| 449 | + }); |
| 450 | + } |
| 451 | + |
| 452 | + // Re-apply width and tooltips after each data render |
395 | 453 | grid.jqGrid("setGridParam", { |
396 | 454 | gridComplete: function () { |
397 | 455 | setTimeout(function () { |
398 | 456 | resizeSessionsGrid(); |
| 457 | + applySessionsTooltips(); |
399 | 458 | }, 0); |
400 | 459 | } |
401 | 460 | }); |
402 | 461 |
|
403 | 462 | // Ensure width is correct after page load (fonts/tabs/layout final width) |
404 | 463 | $(window).on("load", function () { |
405 | 464 | resizeSessionsGrid(); |
| 465 | + applySessionsTooltips(); |
406 | 466 | }); |
407 | 467 |
|
408 | 468 | // If tabs affect layout, recalc when tab is shown (Bootstrap) + fallback click |
@@ -470,23 +530,6 @@ function toggleAdvancedSearch() { |
470 | 530 | grid.jqGrid("searchGrid", prmSearch); |
471 | 531 | } |
472 | 532 |
|
473 | | - function resizeSessionsGrid() { |
474 | | - var container = document.getElementById("session-table"); |
475 | | - if (!container) { |
476 | | - return; |
477 | | - } |
478 | | - |
479 | | - var rect = container.getBoundingClientRect(); |
480 | | - var newWidth = Math.floor(rect.width); |
481 | | - |
482 | | - // Avoid applying invalid widths (e.g. while hidden inside a tab) |
483 | | - if (!newWidth || newWidth < 200) { |
484 | | - return; |
485 | | - } |
486 | | - |
487 | | - grid.jqGrid("setGridWidth", newWidth, true); |
488 | | - } |
489 | | - |
490 | 533 | var prmSearch = { |
491 | 534 | multipleSearch: true, |
492 | 535 | overlay: false, |
@@ -622,6 +665,7 @@ function resizeSessionsGrid() { |
622 | 665 | // Initial paint adjustments |
623 | 666 | setTimeout(function() { |
624 | 667 | resizeSessionsGrid(); |
| 668 | + applySessionsTooltips(); |
625 | 669 | }, 0); |
626 | 670 | }); |
627 | 671 | </script> |
@@ -667,7 +711,7 @@ function resizeSessionsGrid() { |
667 | 711 |
|
668 | 712 | echo Display::toolbarAction('toolbar', [$actionsLeft, $actionsRight]); |
669 | 713 | echo SessionManager::getSessionListTabs($listType); |
670 | | -echo '<div id="session-table" class="table-responsive">'; |
| 714 | +echo '<div id="session-table" class="table-responsive sessions-grid-wrap">'; |
671 | 715 | echo Display::grid_html('sessions'); |
672 | 716 | echo '</div>'; |
673 | 717 |
|
|
0 commit comments