Ability to provide a dropdown container to a text input. Applied to framework export.

This commit is contained in:
yflory
2020-01-16 14:52:04 +01:00
parent 9abeada1f0
commit b80d3cf24f
6 changed files with 76 additions and 7 deletions

View File

@@ -2896,9 +2896,11 @@ define([
var $button = $('<button>', {
'class': ''
}).append($('<span>', {'class': 'cp-dropdown-button-title'}).html(config.text || ""));
/*$('<span>', {
'class': 'fa fa-caret-down',
}).appendTo($button);*/
if (config.caretDown) {
$('<span>', {
'class': 'fa fa-caret-down',
}).prependTo($button);
}
// Menu
var $innerblock = $('<div>', {'class': 'cp-dropdown-content'});
@@ -2965,6 +2967,9 @@ define([
if (config.isSelect) {
var pressed = '';
var to;
$container.on('click', 'a', function () {
value = $(this).data('value');
});
$container.keydown(function (e) {
var $value = $innerblock.find('[data-value].cp-dropdown-element-active:visible');
if (e.which === 38) { // Up