Add theme overview on hover
This commit is contained in:
parent
bfba5ff33b
commit
3dbced46f1
1 changed files with 16 additions and 2 deletions
|
@ -272,12 +272,26 @@ define([
|
|||
|
||||
setTheme(lastTheme, $block);
|
||||
|
||||
$block.find('a').click(function () {
|
||||
var isHovering = false;
|
||||
var $aThemes = $block.find('a');
|
||||
$aThemes.mouseenter(function () {
|
||||
isHovering = true;
|
||||
var theme = $(this).attr('data-value');
|
||||
setTheme(theme, $block);
|
||||
});
|
||||
$aThemes.mouseleave(function () {
|
||||
if (isHovering) {
|
||||
setTheme(lastTheme, $block);
|
||||
Common.setAttribute(themeKey, lastTheme);
|
||||
}
|
||||
});
|
||||
$aThemes.click(function () {
|
||||
isHovering = false;
|
||||
var theme = $(this).attr('data-value');
|
||||
setTheme(theme, $block);
|
||||
Common.setAttribute(themeKey, theme);
|
||||
});
|
||||
|
||||
|
||||
if ($drawer) { $drawer.append($block); }
|
||||
if (cb) { cb(); }
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue