Add theme overview on hover
This commit is contained in:
@@ -272,12 +272,26 @@ define([
|
|||||||
|
|
||||||
setTheme(lastTheme, $block);
|
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');
|
var theme = $(this).attr('data-value');
|
||||||
setTheme(theme, $block);
|
setTheme(theme, $block);
|
||||||
Common.setAttribute(themeKey, theme);
|
Common.setAttribute(themeKey, theme);
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($drawer) { $drawer.append($block); }
|
if ($drawer) { $drawer.append($block); }
|
||||||
if (cb) { cb(); }
|
if (cb) { cb(); }
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user