Skip to content

Commit

Permalink
Merge pull request #56 from LowerRockLabs/develop
Browse files Browse the repository at this point in the history
Fixes for Always Open Filters
  • Loading branch information
lrljoe authored Mar 16, 2023
2 parents ecd65e9 + b572a44 commit 2e605fa
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
10 changes: 6 additions & 4 deletions resources/views/components/tools/filters/datePicker.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@
document.getElementById('{{ $filterLabelPath }}-labelInternal').classList.remove('d-none');
}
@if ($theme === 'tailwind') for (let i = 0; i < this.twMenuElements.length; i++) {
if (this.twMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.twMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.twMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.twMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: true }');
this.twMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
@if ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') for (let i = 0; i < this.bsMenuElements.length; i++) {
if (this.bsMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.bsMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: false }');
this.bsMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
Expand Down
10 changes: 6 additions & 4 deletions resources/views/components/tools/filters/dateRange.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@
}
@if ($theme === 'tailwind') for (let i = 0; i < this.twMenuElements.length; i++) {
if (this.twMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.twMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.twMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.twMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: true }');
this.twMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
@if ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') for (let i = 0; i < this.bsMenuElements.length; i++) {
if (this.bsMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.bsMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: false }');
this.bsMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
Expand Down
11 changes: 7 additions & 4 deletions resources/views/components/tools/filters/numberRange.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@
document.getElementById('{{ $filterLabelPath }}-labelInternal').classList.remove('d-none');
}
@if ($theme === 'tailwind') for (let i = 0; i < this.twMenuElements.length; i++) {
if (this.twMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.twMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.twMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.twMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: true }');
this.twMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
@if ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') for (let i = 0; i < this.bsMenuElements.length; i++) {
if (this.bsMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.bsMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: false }');
this.bsMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
},
updateStyles() {
document.getElementById('{{ $filterBasePath }}').style.setProperty('--value-b', $refs.filterMin.value);
Expand Down
8 changes: 5 additions & 3 deletions resources/views/components/tools/filters/slimSelect.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@
document.getElementById('{{ $filterLabelPath }}-labelInternal').classList.remove('d-none');
}
@if ($theme === 'tailwind') for (let i = 0; i < this.twMenuElements.length; i++) {
if (this.twMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
if (!this.twMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.twMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
this.twMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
@if ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') for (let i = 0; i < this.bsMenuElements.length; i++) {
if (this.bsMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.bsMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: false }');
this.bsMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
Expand Down
10 changes: 6 additions & 4 deletions resources/views/components/tools/filters/smartSelect.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@
document.getElementById('{{ $filterLabelPath }}-labelInternal').classList.remove('d-none');
}
@if ($theme === 'tailwind') for (let i = 0; i < this.twMenuElements.length; i++) {
if (this.twMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.twMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.twMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.twMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: true }');
this.twMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
@if ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') for (let i = 0; i < this.bsMenuElements.length; i++) {
if (this.bsMenuElements.item(i).getAttribute('x-data') != '{ open: true, childElementOpen: true }') {
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: true, childElementOpen: true }');
if (!this.bsMenuElements.item(i).getAttribute('x-data').includes('childElementOpen'))
{
this.bsMenuElements.item(i).setAttribute('x-data', '{ open: false, childElementOpen: false }');
this.bsMenuElements.item(i).setAttribute('x-on:mousedown.away', 'if (!childElementOpen) { open = false }');
}
} @endif
Expand Down

0 comments on commit 2e605fa

Please sign in to comment.