Skip to content

Commit

Permalink
Move scmap/functions to helpers/functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Leeft committed Dec 27, 2015
1 parent 192af7e commit 458dc21
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/scmap/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import UI from './ui';
import config from './config';
import settings from './settings';
import xhrPromise from '../helpers/xhr-promise';
import { hasLocalStorage, hasSessionStorage } from './functions';
import { hasLocalStorage, hasSessionStorage } from '../helpers/functions';
import { ui, renderer, scene } from '../starcitizen-webgl-map';
import DisplayState from './map/display-state';

Expand Down
2 changes: 1 addition & 1 deletion src/scmap/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { allSystems } from './systems';
import Dijkstra from './dijkstra';
import UI from './ui';
import settings from './settings';
import { hasSessionStorage } from './functions';
import { hasSessionStorage } from '../helpers/functions';
import { scene, map } from '../starcitizen-webgl-map';

import THREE from 'three';
Expand Down
2 changes: 1 addition & 1 deletion src/scmap/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import $ from 'jquery';
import config from './config';
import { hasLocalStorage, hasSessionStorage } from './functions';
import { hasLocalStorage, hasSessionStorage } from '../helpers/functions';

import THREE from 'three';

Expand Down
2 changes: 1 addition & 1 deletion src/scmap/systems.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import SCMAP from '../scmap';
import StarSystem from './star-system';
import { humanSort } from './functions';
import { humanSort } from '../helpers/functions';

let allSystems = [];

Expand Down
2 changes: 1 addition & 1 deletion src/scmap/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import MapSymbols from './symbols';
import { allSystems } from './systems';
import config from './config';
import settings from './settings';
import { hasLocalStorage, hasSessionStorage } from './functions';
import { hasLocalStorage, hasSessionStorage } from '../helpers/functions';
import { renderer } from '../starcitizen-webgl-map';

// Import the templates
Expand Down
10 changes: 6 additions & 4 deletions src/scmap/ui/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
*/

import SCMAP from '../../scmap';
import StarSystem, { GLOW_SCALE } from '../star-system';
import StarSystem from '../star-system';
import Faction from '../faction';
import UI from '../ui';
import { hasSessionStorage } from '../functions';
import { hasSessionStorage } from '../../helpers/functions';

import Handlebars from 'handlebars/handlebars.runtime';
import markdown from 'markdown';
Expand All @@ -16,18 +16,20 @@ import $ from 'jquery';
let sectionLevel = 1;
let tabCounter = 0;

let storage = {};

Handlebars.registerHelper( 'uiSection', function( title, shouldOpen, options ) {
let opened = ( shouldOpen ) ? true : false;
let icon = 'fa-caret-right';
let hidden = 'style="display: none;"';
let attrs = [], str;
let oldLevel = sectionLevel++;
let storage = null;

if ( hasSessionStorage() ) {
storage = window.sessionStorage;
}

if ( storage && ( title in storage ) ) {
if ( title in storage ) {
opened = ( storage[ title ] == '1' ) ? true : false;
}

Expand Down

0 comments on commit 458dc21

Please sign in to comment.