Skip to content

Commit

Permalink
Add selected branch/tag to sessionStorage (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatJoeMoore authored and blakemorgan committed Jul 12, 2017
1 parent 914c9a1 commit f1795f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/load-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@
var root = '//cdn.byu.edu/byu-theme-components/';
var min = true;

var storedVersion = window.sessionStorage.getItem('version');

// allow user to set a version or branch in the querystring
var version = getParameterByName('version');
if (!version)
{
version = 'latest';
if (!version) {
version = storedVersion || 'latest';
}
var branch = getParameterByName('branch');

if (branch)
{
var branch = getParameterByName('branch');
if (branch) {
version = 'experimental/' + branch;
}
window.sessionStorage.setItem('version', version);
root = root + version;

var isLocalhost = checkIfLocalhost();

// allow testing other branches from localhost
if (version != 'latest')
if (version !== 'latest')
isLocalhost = false;

var isForced = window.location.search && window.location.search.indexOf('load-local=true') >= 0;
Expand Down

0 comments on commit f1795f7

Please sign in to comment.