diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 3638b5332..ef67984c5 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -173,6 +173,7 @@ $labels['last'] = 'Last'; $labels['previous'] = 'Previous'; $labels['next'] = 'Next'; $labels['select'] = 'Select'; +$labels['selection'] = 'Selection'; $labels['all'] = 'All'; $labels['none'] = 'None'; $labels['currpage'] = 'Current page'; diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 70b833236..1899cdb80 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -359,8 +359,9 @@ function rcube_elastic_ui() */ function create_cloned_button(target, menu_button, add_class) { - var button = $(''), - target_id = target.attr('id'), + var popup, click = true, + button = $(''), + target_id = target.attr('id') || new Date().getTime(), button_id = target_id + '-clone', btn_class = target[0].className + (add_class ? ' ' + add_class : ''); @@ -368,10 +369,18 @@ function rcube_elastic_ui() btn_class = $.trim(btn_class.replace('btn-primary', 'primary').replace(/(btn[a-z-]*|button|disabled)/g, '')) btn_class += ' button disabled'; } + else if (popup = target.data('popup')) { + button.data('popup', popup).data('toggle-button', target.data('toggle-button')); + popup_init(button[0]); + click = false; + } + + button.attr({id: button_id, href: '#', 'class': btn_class}) + .append($('').text(target.text())); - button.attr({'onclick': '', id: button_id, href: '#', 'class': btn_class}) - .append($('').text(target.text())) - .on('click', function(e) { target.click(); }); + if (click) { + button.on('click', function(e) { target.click(); }); + } if (is_framed && !menu_button) { button.data('target', target);