|
|
@ -231,7 +231,20 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var $block = exp.$language = UIElements.createDropdown(dropdownConfig);
|
|
|
|
var $block = exp.$language = UIElements.createDropdown(dropdownConfig);
|
|
|
|
$block.find('button').attr('title', Messages.languageButtonTitle);
|
|
|
|
$block.find('button').attr('title', Messages.languageButtonTitle);
|
|
|
|
$block.find('a').click(function () {
|
|
|
|
|
|
|
|
|
|
|
|
var isHovering = false;
|
|
|
|
|
|
|
|
var $aLanguages = $block.find('a');
|
|
|
|
|
|
|
|
$aLanguages.mouseenter(function () {
|
|
|
|
|
|
|
|
isHovering = true;
|
|
|
|
|
|
|
|
setMode($(this).attr('data-value'));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$aLanguages.mouseleave(function () {
|
|
|
|
|
|
|
|
if (isHovering) {
|
|
|
|
|
|
|
|
setMode($block.find(".cp-dropdown-element-active").attr('data-value'));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$aLanguages.click(function () {
|
|
|
|
|
|
|
|
isHovering = false;
|
|
|
|
setMode($(this).attr('data-value'), onModeChanged);
|
|
|
|
setMode($(this).attr('data-value'), onModeChanged);
|
|
|
|
onLocal();
|
|
|
|
onLocal();
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -272,7 +285,21 @@ 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);
|
|
|
|