File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
resources/views/components Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11@props ([
2+ ' direction' => null ,
23 ' fullscreen' => false ,
34] )
45
56<div {!! $attributes -> class ([
67 ' pt-20 sm:p-5' => ! $fullscreen ,
78 ' size-full min-w-0 flex pointer-events-none [&>*]:pointer-events-auto' ,
89]) ! !} x-data =" {
10+ modalDirection: {{ $direction ? Js:: from ($direction ) : ' [0, 0]' } } ,
911 modalPosition: [null, null],
10- get modalStackDirection () {
12+ computeModalDirection () {
1113 const [px, py] = this.modalPosition;
1214
1315 const directions = {
3234 return [px, py];
3335 },
3436 init() {
35- this.$nextTick(() => {
37+ @if ( ! $direction ) this.$nextTick(() => {
3638 this.modalPosition = this.computeModalPosition();
37- });
39+ this.modalDirection = this.computeModalDirection();
40+ }); @endif
41+
3842 },
3943 modalAttributes: {
4044 ['x-show']() { return isModalStacked ? modalHistory.includes(modalId) : isModalActive; },
4145 ['x-bind:inert']() { return !isModalActive },
4246 ['x-bind:style']() {
4347 if (isModalStacked) {
44- const [dx, dy] = this.modalStackDirection ;
48+ const [dx, dy] = this.modalDirection ;
4549
4650 return {
4751 '--dx': dx,
You can’t perform that action at this time.
0 commit comments