live preview of themes in demo
This commit is contained in:
parent
9245e4bd1b
commit
2538e85780
1 changed files with 18 additions and 0 deletions
|
|
@ -390,10 +390,28 @@ function saveOption(el, val) {
|
|||
}
|
||||
}
|
||||
|
||||
themeEl.addEventListener("mouseover", function(e){
|
||||
this.desiredValue = e.target.value;
|
||||
if (!this.$timer)
|
||||
this.$timer = setTimeout(this.updateTheme);
|
||||
})
|
||||
|
||||
themeEl.addEventListener("mouseout", function(e){
|
||||
this.desiredValue = null;
|
||||
if (!this.$timer)
|
||||
this.$timer = setTimeout(this.updateTheme, 20);
|
||||
})
|
||||
|
||||
themeEl.updateTheme = function(){
|
||||
env.split.setTheme(themeEl.desiredValue || themeEl.selectedValue);
|
||||
themeEl.$timer = null;
|
||||
}
|
||||
|
||||
bindDropdown("theme", function(value) {
|
||||
if (!value)
|
||||
return;
|
||||
env.editor.setTheme(value);
|
||||
themeEl.selectedValue = value;
|
||||
});
|
||||
|
||||
bindDropdown("keybinding", function(value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue