Skip to content

Commit 04e510d

Browse files
authored
Update ViewFileDialog.php
1 parent 6150d12 commit 04e510d

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

wfc/ui/vuetify/ViewFileDialog.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct(string $model, string $downloadAction = null) {
2828
parent::__construct($model, true);
2929
$this->setAttribute('width', '70%');
3030
$this->removeAttribute('max-width');
31+
$this->setAttribute(':fullscreen', $model.'.fullscreen');
3132
$this->getToolbar()->addChild(new VBtn([
3233
'icon',
3334
'dark',
@@ -44,14 +45,45 @@ public function __construct(string $model, string $downloadAction = null) {
4445
]));
4546
}
4647

48+
49+
4750
$this->addToBody('object', [
51+
'v-if' => '!'.$model.'.fullscreen',
4852
':data' => $model.'.file',
4953
':type' => $model.'.mime',
5054
'style' => [
5155
'height' => '500px',
5256
'width' => '100%'
5357
]
5458
]);
59+
$this->addToBody('object', [
60+
'v-else',
61+
':data' => $model.'.file',
62+
':type' => $model.'.mime',
63+
'class' => 'fill-height',
64+
'style' => [
65+
'width' => '100%'
66+
]
67+
]);
68+
}
69+
/**
70+
* Adds buttons to head section of the dialog to minimize and maximize its size.
71+
*/
72+
public function includeFullScreenButton() {
73+
$this->getToolbar()->addChild(new VBtn([
74+
'icon',
75+
'dark',
76+
'@click' => $this->getModel().".fullscreen = true",
77+
'icon' => 'mdi-arrow-expand-all',
78+
'v-if' => '!'.$this->getModel().'.fullscreen'
79+
]));
80+
81+
$this->getToolbar()->addChild(new VBtn([
82+
'icon',
83+
'dark',
84+
'@click' => $this->getModel().".fullscreen = false",
85+
'icon' => 'mdi-arrow-collapse-all',
86+
'v-if' => $this->getModel().'.fullscreen'
87+
]));
5588
}
56-
5789
}

0 commit comments

Comments
 (0)