Skip to content

Commit b4d83c0

Browse files
committed
Fix color selection after navigation
1 parent 59ecbbc commit b4d83c0

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

docs/lib/themes.coffee

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ compileTheme = (body, args={}) ->
1717
# It matters that args is in the context
1818
Color = window.Color
1919
val = eval(code)
20-
console.log(val)
2120

2221
val
2322

docs/lib/themes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
} else {
2828
Color = window.Color;
2929
val = eval(code);
30-
console.log(val);
3130
}
3231
return val;
3332
});

docs/themes/index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h2>Themes</h2>
5252
<input type="color" value="#2299dd"></input>
5353
<div class="themes"></div>
5454
<script>
55-
(function(){
55+
$(function(){
5656
var themes = [{
5757
name: 'minimal',
5858
title: 'Minimal',
@@ -96,8 +96,13 @@ <h2>Themes</h2>
9696
'</div>');
9797
});
9898

99+
var $color = $('input[type="color"]');
100+
99101
var cssCache = {};
100102
var initFrame = function(frame, color){
103+
if ($color.val() != '#2299dd')
104+
color = $color.val();
105+
101106
var $styleEl = $('<style>')
102107
$(frame).contents().find('body').append($styleEl);
103108

@@ -137,7 +142,7 @@ <h2>Themes</h2>
137142
}, 0);
138143
});
139144

140-
$('input[type="color"]').change(function(){
145+
$color.change(function(){
141146
updateColor($(this).val());
142147
});
143148

@@ -148,7 +153,7 @@ <h2>Themes</h2>
148153

149154
downloadTheme(theme);
150155
});
151-
})();
156+
});
152157
</script>
153158
</div>
154159
</body>

0 commit comments

Comments
 (0)