Standardizing bracket syntax

This commit is contained in:
James Barnsley
2017-10-10 13:05:28 +13:00
parent 0ca37b0f62
commit 2ffa337ffa
116 changed files with 7451 additions and 3246 deletions

View File

@ -46,20 +46,20 @@ export function hideTouchContextMenu(){
}
}
export function lazyLoading( start ){
export function lazyLoading(start){
return {
type: 'LAZY_LOADING',
start: start
}
}
export function toggleSidebar( new_state = 'toggle' ){
export function toggleSidebar(new_state = 'toggle'){
var action = { type: 'TOGGLE_SIDEBAR' }
if( new_state != 'toggle' ) action.new_state = new_state
if (new_state != 'toggle' ) action.new_state = new_state
return action
}
export function dragStart( e, context, from_uri = null, victims, victims_indexes = null ){
export function dragStart(e, context, from_uri = null, victims, victims_indexes = null){
return {
type: 'DRAG_START',
context: context,
@ -79,7 +79,7 @@ export function dragEnd(){
return { type: 'DRAG_END' }
}
export function set( data ){
export function set(data){
return {
type: 'UI_SET',
data: data
@ -94,7 +94,7 @@ export function set( data ){
* Immersive full-screen dialog
**/
export function openModal( name, data ){
export function openModal(name, data){
return {
type: 'OPEN_MODAL',
modal: {
@ -117,7 +117,7 @@ export function closeModal(){
* Subtle info/tooltip messages
**/
export function createBrowserNotification( data ){
export function createBrowserNotification(data){
return {
type: 'BROWSER_NOTIFICATION',
data: data

View File

@ -41,8 +41,8 @@ const UIMiddleware = (function(){
// handle nested data objects
var data = {}
if( typeof(action.data) ) data = action.data
if( typeof(data.data) ) data = Object.assign({}, data, data.data)
if (typeof(action.data) ) data = action.data
if (typeof(data.data) ) data = Object.assign({}, data, data.data)
// construct our browser notification
var title = '';
@ -52,12 +52,12 @@ const UIMiddleware = (function(){
lang: 'EN',
tag: 'iris'
};
if( data.title ) title = data.title;
if( data.body ) options.body = data.body;
if( data.icon ) options.icon = data.icon;
if (data.title ) title = data.title;
if (data.body ) options.body = data.body;
if (data.icon ) options.icon = data.icon;
// make it so
var notification = new notification( title, options );
var notification = new notification(title, options );
break
case 'CREATE_NOTIFICATION':
@ -78,7 +78,7 @@ const UIMiddleware = (function(){
case 'REMOVE_NOTIFICATION':
var notifications = Object.assign([], store.getState().ui.notifications)
function getByKey( notification ){
function getByKey(notification){
return notification.key === action.key
}
var index = notifications.findIndex(getByKey)

View File

@ -2,7 +2,7 @@
import * as helpers from '../../helpers'
export default function reducer(ui = {}, action){
switch (action.type) {
switch (action.type){
case 'LAZY_LOADING':
return Object.assign({}, ui, { lazy_loading: action.start });
@ -18,7 +18,7 @@ export default function reducer(ui = {}, action){
case 'TOGGLE_SIDEBAR':
var new_state = !ui.sidebar_open
if( typeof(action.new_state) !== 'undefined' ) new_state = action.new_state
if (typeof(action.new_state) !== 'undefined' ) new_state = action.new_state
return Object.assign({}, ui, { sidebar_open : new_state })
case 'SET_SELECTED_TRACKS':
@ -100,7 +100,7 @@ export default function reducer(ui = {}, action){
case 'REMOVE_NOTIFICATION':
var notifications = Object.assign([], ui.notifications)
if( action.index > -1 ){
if (action.index > -1){
notifications.splice(action.index, 1)
}