summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/include/rcmail_output_html.php2
-rw-r--r--program/js/app.js12
-rw-r--r--program/lib/Roundcube/html.php15
3 files changed, 23 insertions, 6 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 17b5b9647..45cb9f0d9 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -1216,7 +1216,7 @@ class rcmail_output_html extends rcmail_output
// generate html code for button
if ($btn_content) {
- $attrib_str = html::attrib_string($attrib, $link_attrib);
+ $attrib_str = html::attrib_string($attrib, array_merge($link_attrib, array('data-*')));
$out = sprintf('<a%s>%s</a>', $attrib_str, $btn_content);
}
diff --git a/program/js/app.js b/program/js/app.js
index 1ef341415..eb9b9ced8 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -6670,8 +6670,9 @@ function rcube_webmail()
this.element_position = function(element, obj)
{
var obj = $(obj), win = $(window),
- width = obj.width(),
- height = obj.height(),
+ width = obj.outerWidth(),
+ height = obj.outerHeight(),
+ menu_pos = obj.data('menu-pos'),
win_height = win.height(),
elem_height = $(element).height(),
elem_width = $(element).width(),
@@ -6679,6 +6680,13 @@ function rcube_webmail()
top = pos.top,
left = pos.left + width;
+ if (menu_pos == 'bottom') {
+ top += height;
+ left -= width;
+ }
+ else
+ left -= 5;
+
if (top + elem_height > win_height) {
top -= elem_height - height;
if (top < 0)
diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php
index 33517fbcd..64324dd8e 100644
--- a/program/lib/Roundcube/html.php
+++ b/program/lib/Roundcube/html.php
@@ -269,19 +269,28 @@ class html
return '';
}
- $allowed_f = array_flip((array)$allowed);
+ $allowed_f = array_flip((array)$allowed);
$attrib_arr = array();
+
foreach ($attrib as $key => $value) {
// skip size if not numeric
if ($key == 'size' && !is_numeric($value)) {
continue;
}
- // ignore "internal" or not allowed attributes
- if ($key == 'nl' || ($allowed && !isset($allowed_f[$key])) || $value === null) {
+ // ignore "internal" or empty attributes
+ if ($key == 'nl' || $value === null) {
continue;
}
+ // ignore not allowed attributes
+ if (!empty($allowed)) {
+ $is_data_attr = substr_compare($key, 'data-', 0, 5) === 0;
+ if (!isset($allowed_f[$key]) && (!$is_data_attr || !isset($allowed_f['data-*']))) {
+ continue;
+ }
+ }
+
// skip empty eventhandlers
if (preg_match('/^on[a-z]+/', $key) && !$value) {
continue;