Autocomplete on key press in some dropdown menus
This commit is contained in:
@@ -81,7 +81,7 @@ define([
|
||||
editor.setOption('mode', mode);
|
||||
if ($select) {
|
||||
var name = $select.find('a[data-value="' + mode + '"]').text() || 'Mode';
|
||||
$select.find('.buttonTitle').text(name);
|
||||
$select.setValue(name);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -110,7 +110,9 @@ define([
|
||||
}
|
||||
editor.setOption('theme', theme);
|
||||
}
|
||||
if ($select) { $select.find('.buttonTitle').text(theme || 'Theme'); }
|
||||
if ($select) {
|
||||
$select.setValue(theme || 'Theme');
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
@@ -438,13 +440,14 @@ define([
|
||||
text: 'Mode', // Button initial text
|
||||
options: options, // Entries displayed in the menu
|
||||
left: true, // Open to the left of the button
|
||||
isSelect: true,
|
||||
};
|
||||
var $block = module.$language = Cryptpad.createDropdown(dropdownConfig);
|
||||
var $button = $block.find('.buttonTitle');
|
||||
|
||||
$block.find('a').click(function (e) {
|
||||
setMode($(this).attr('data-value'));
|
||||
$button.text($(this).text());
|
||||
setMode($(this).attr('data-value'), $block);
|
||||
onLocal();
|
||||
});
|
||||
|
||||
$rightside.append($block);
|
||||
@@ -471,6 +474,8 @@ define([
|
||||
text: 'Theme', // Button initial text
|
||||
options: options, // Entries displayed in the menu
|
||||
left: true, // Open to the left of the button
|
||||
isSelect: true,
|
||||
initialValue: lastTheme
|
||||
};
|
||||
var $block = module.$theme = Cryptpad.createDropdown(dropdownConfig);
|
||||
var $button = $block.find('.buttonTitle');
|
||||
@@ -480,7 +485,6 @@ define([
|
||||
$block.find('a').click(function (e) {
|
||||
var theme = $(this).attr('data-value');
|
||||
setTheme(theme, $block);
|
||||
$button.text($(this).text());
|
||||
localStorage.setItem(themeKey, theme);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user