Skip to content

Commit

Permalink
Merge pull request google#978 from rachel-fenichel/feature/developer_…
Browse files Browse the repository at this point in the history
…background

Set background color to lilac if opening the playground from file:
  • Loading branch information
rachel-fenichel committed Mar 13, 2017
2 parents 847d83e + a6a70a6 commit 036f364
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
var fakeDragStack = [];

function start() {
setBackgroundColor();

// Parse the URL arguments.
var match = location.search.match(/dir=([^&]+)/);
var rtl = match && match[1] == 'rtl';
Expand Down Expand Up @@ -117,6 +119,17 @@
taChange();
}

function setBackgroundColor() {
var lilac = '#d6d6ff';

var currentPage = window.location.href;
var regexFile = /^file[\S]*$/;

if (regexFile.test(currentPage)) {
document.getElementsByTagName('body')[0].style.backgroundColor = lilac;
}
}

function getToolboxElement() {
var match = location.search.match(/toolbox=([^&]+)/);
return document.getElementById('toolbox-' + (match ? match[1] : 'categories'));
Expand Down

0 comments on commit 036f364

Please sign in to comment.