playerPanel focus 수정

This commit is contained in:
고동영
2024-04-25 16:57:39 +09:00
parent db96ab7e58
commit 1d08464d95
6 changed files with 115 additions and 63 deletions

View File

@@ -1,10 +1,10 @@
import Spotlight from '@enact/spotlight';
import { URLS } from '../api/apiConfig';
import { TAxios } from '../api/TAxios';
import { panel_names } from '../utils/Config';
import { types } from './actionTypes';
import { popPanel, pushPanel, updatePanel } from './panelActions';
import Spotlight from "@enact/spotlight";
import { URLS } from "../api/apiConfig";
import { TAxios } from "../api/TAxios";
import { panel_names } from "../utils/Config";
import { types } from "./actionTypes";
import { popPanel, pushPanel, updatePanel } from "./panelActions";
//yhcho
/*
@@ -23,30 +23,41 @@ import { popPanel, pushPanel, updatePanel } from './panelActions';
let startVideoTimer = null;
//start modal mode
//start Full -> modal mode
export const startVideoPlayer = ({ modal, modalContainerId, modalClassName, ...rest }) => (dispatch, getState) => {
const panels = getState().panels.panels;
const topPanel = panels[panels.length -1];
let panelWorkingAction = pushPanel;
if(topPanel && topPanel.name === panel_names.PLAYER_PANEL){
panelWorkingAction = updatePanel;
}
dispatch(panelWorkingAction({
name: panel_names.PLAYER_PANEL,
panelInfo: {
modal,
modalContainerId,
modalClassName,
...rest
export const startVideoPlayer =
({ modal, modalContainerId, modalClassName, spotlightDisable, ...rest }) =>
(dispatch, getState) => {
const panels = getState().panels.panels;
const topPanel = panels[panels.length - 1];
let panelWorkingAction = pushPanel;
if (topPanel && topPanel.name === panel_names.PLAYER_PANEL) {
panelWorkingAction = updatePanel;
}
}, true));
if(modal && modalContainerId){
Spotlight.focus(modalContainerId);
}
};
dispatch(
panelWorkingAction(
{
name: panel_names.PLAYER_PANEL,
panelInfo: {
modal,
modalContainerId,
modalClassName,
...rest,
},
},
true
)
);
if (modal && modalContainerId && !spotlightDisable) {
Spotlight.focus(modalContainerId);
}
};
export const finishVideoPreview = () => (dispatch, getState) => {
const panels = getState().panels.panels;
const topPanel = panels[panels.length -1];
if(topPanel && topPanel.name === panel_names.PLAYER_PANEL && topPanel.panelInfo.modal){
const topPanel = panels[panels.length - 1];
if (
topPanel &&
topPanel.name === panel_names.PLAYER_PANEL &&
topPanel.panelInfo.modal
) {
dispatch(popPanel());
}
};