Removing test scrolling; Icon library to prevent cache lag
This commit is contained in:
@ -105,6 +105,38 @@ export function set(data){
|
||||
}
|
||||
}
|
||||
|
||||
export function getIcon(name){
|
||||
return (dispatch, getState) => {
|
||||
var config = {
|
||||
method: 'GET',
|
||||
timeout: 15000,
|
||||
url: 'assets/icons/'+name+'.svg'
|
||||
}
|
||||
$.ajax(config).then(
|
||||
response => {
|
||||
dispatch({
|
||||
type: 'ICON_LOADED',
|
||||
key: name,
|
||||
icon: new XMLSerializer().serializeToString(response)
|
||||
})
|
||||
},
|
||||
(xhr, status, error) => {
|
||||
dispatch(
|
||||
handleException(
|
||||
'Could not load '+name+' icon',
|
||||
{
|
||||
config: config,
|
||||
xhr: xhr,
|
||||
status: status,
|
||||
error: error
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -24,6 +24,11 @@ export default function reducer(ui = {}, action){
|
||||
case 'SET_SELECTED_TRACKS':
|
||||
return Object.assign({}, ui, { selected_tracks : Object.assign([],action.keys) })
|
||||
|
||||
case 'ICON_LOADED':
|
||||
var icons = Object.assign({}, ui.icons);
|
||||
icons[action.key] = action.icon;
|
||||
return Object.assign({}, ui, {icons : icons});
|
||||
|
||||
|
||||
/**
|
||||
* Context menu
|
||||
|
||||
Reference in New Issue
Block a user