Skip to content

Commit fed9811

Browse files
committed
Add fullscreen order table view
1 parent 9e7f1bf commit fed9811

4 files changed

Lines changed: 37 additions & 3 deletions

File tree

src/Sylius/Bundle/AdminBundle/Resources/assets/entrypoint.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import './app';
1313

1414
import './scripts/bulk-delete';
1515
import './scripts/check-all';
16+
import './scripts/fullscreen';
1617
import './scripts/menu-search';
1718
import './scripts/spotlight';
1819
import './scripts/statistics_chart';
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* This file is part of the Sylius package.
3+
*
4+
* (c) Sylius Sp. z o.o.
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/
9+
10+
document.querySelectorAll('[data-fullscreen-btn]').forEach(btn => {
11+
btn.addEventListener('click', () => {
12+
const containerId = btn.getAttribute('data-fullscreen-btn');
13+
const container = document.querySelector(`[data-fullscreen-container="${containerId}"]`);
14+
15+
if (!document.fullscreenElement) {
16+
if (container.requestFullscreen) {
17+
container.requestFullscreen();
18+
}
19+
} else {
20+
if (document.exitFullscreen) {
21+
document.exitFullscreen();
22+
}
23+
}
24+
});
25+
});

src/Sylius/Bundle/AdminBundle/Resources/translations/messages.en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ sylius:
7474
create_new:
7575
customer_group: 'Create a new customer group'
7676
delete_avatar: 'Delete avatar'
77+
full_screen: 'Full screen'
7778
global: 'Global'
7879
ip_address: 'IP address'
7980
language: 'Language'
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
<div class="card mb-3">
1+
<div class="card mb-3" data-fullscreen-container="orders">
22
<div class="card-header">
3-
<div class="card-title">{{ 'sylius.ui.items'|trans }}</div>
3+
<div class="card-title">
4+
{{ 'sylius.ui.items'|trans }}
5+
</div>
6+
<div class="card-actions btn-actions">
7+
<div class="btn-action cursor-pointer" data-fullscreen-btn="orders" data-bs-toggle="tooltip" data-bs-title="{{ 'sylius.ui.full_screen'|trans }}">
8+
{{ ux_icon('tabler:maximize') }}
9+
</div>
10+
</div>
411
</div>
512
<div class="table-responsive">
613
<table class="table table-hover table-vcenter card-table" {{ sylius_test_html_attribute('table-items') }}>
7-
{% hook 'items' %}
14+
{% hook 'items' %}
815
</table>
916
</div>
1017
</div>

0 commit comments

Comments
 (0)