File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -255,20 +255,26 @@ function toggleTooltip() {
255255 }
256256}
257257
258- const _isFullscreen = ref (props .isFullscreen );
258+ const _isFullscreen = computed ({
259+ get : () => props .isFullscreen ,
260+ set : (val ) => emit (' toggleFullscreen' , val)
261+ });
259262
260- async function toggleFullscreen () {
263+ function toggleFullscreen () {
261264 if (! props .chartElement ) return ;
262- if (_isFullscreen .value ) {
263- document .exitFullscreen ();
265+
266+ const next = ! props .isFullscreen ;
267+ _isFullscreen .value = next;
268+
269+ if (next) {
270+ props .chartElement .requestFullscreen ()
264271 } else {
265- await props . chartElement . requestFullscreen ();
272+ document . exitFullscreen ();
266273 }
267274}
268275
269276function fullscreenchanged () {
270277 const flag = !! document .fullscreenElement ;
271- _isFullscreen .value = flag;
272278 emit (' toggleFullscreen' , flag);
273279}
274280
You can’t perform that action at this time.
0 commit comments