mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-02 15:03:53 +00:00
Combine window hiding
This commit is contained in:
parent
4f9767bd2a
commit
bc75d6efb9
3 changed files with 7 additions and 21 deletions
|
|
@ -12,8 +12,7 @@ import {
|
|||
TOGGLE_WINDOW,
|
||||
CLOSE_WINDOW,
|
||||
TOGGLE_WINDOW_SHADE_MODE,
|
||||
HIDE_WINDOW,
|
||||
SHOW_WINDOW
|
||||
SET_WINDOW_VISIBILITY
|
||||
} from "../actionTypes";
|
||||
|
||||
import { getPositionDiff } from "../resizeUtils";
|
||||
|
|
@ -85,11 +84,11 @@ export function closeWindow(windowId) {
|
|||
}
|
||||
|
||||
export function hideWindow(windowId) {
|
||||
return { type: HIDE_WINDOW, windowId };
|
||||
return { type: SET_WINDOW_VISIBILITY, windowId, hidden: true };
|
||||
}
|
||||
|
||||
export function showWindow(windowId) {
|
||||
return { type: SHOW_WINDOW, windowId };
|
||||
return { type: SET_WINDOW_VISIBILITY, windowId, hidden: false };
|
||||
}
|
||||
|
||||
export function setWindowSize(windowId, size) {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,5 @@ export const REGISTER_VISUALIZER = "REGISTER_VISUALIZER";
|
|||
export const SET_Z_INDEX = "SET_Z_INDEX";
|
||||
export const DISABLE_MARQUEE = "DISABLE_MARQUEE";
|
||||
export const SET_DUMMY_VIZ_DATA = "SET_DUMMY_VIZ_DATA";
|
||||
export const HIDE_WINDOW = "HIDE_WINDOW";
|
||||
export const SHOW_WINDOW = "SHOW_WINDOW";
|
||||
export const SET_WINDOW_VISIBILITY = "SET_WINDOW_VISIBILITY";
|
||||
export const LOADING = "LOADING";
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ import {
|
|||
SET_FOCUSED_WINDOW,
|
||||
TOGGLE_WINDOW,
|
||||
CLOSE_WINDOW,
|
||||
HIDE_WINDOW,
|
||||
SHOW_WINDOW,
|
||||
SET_WINDOW_VISIBILITY,
|
||||
ADD_GEN_WINDOW,
|
||||
UPDATE_WINDOW_POSITIONS,
|
||||
WINDOW_SIZE_CHANGED,
|
||||
|
|
@ -99,25 +98,14 @@ const windows = (state = defaultWindowsState, action) => {
|
|||
}
|
||||
}
|
||||
};
|
||||
case HIDE_WINDOW:
|
||||
case SET_WINDOW_VISIBILITY:
|
||||
return {
|
||||
...state,
|
||||
genWindows: {
|
||||
...state.genWindows,
|
||||
[action.windowId]: {
|
||||
...state.genWindows[action.windowId],
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
};
|
||||
case SHOW_WINDOW:
|
||||
return {
|
||||
...state,
|
||||
genWindows: {
|
||||
...state.genWindows,
|
||||
[action.windowId]: {
|
||||
...state.genWindows[action.windowId],
|
||||
hidden: true
|
||||
hidden: action.hidden
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue