Merge remote-tracking branch 'origin/padsTheme' into staging

pull/1/head
yflory 6 years ago
commit e77207dfee

@ -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);

@ -458,6 +458,7 @@ define([
mkHelpMenu(framework); mkHelpMenu(framework);
CodeMirror.mkIndentSettings(framework._.cpNfInner.metadataMgr); CodeMirror.mkIndentSettings(framework._.cpNfInner.metadataMgr);
CodeMirror.init(framework.localChange, framework._.title, framework._.toolbar);
CodeMirror.configureTheme(common); CodeMirror.configureTheme(common);
framework.onContentUpdate(function (newContent) { framework.onContentUpdate(function (newContent) {

Loading…
Cancel
Save