Skip to content
Snippets Groups Projects
Commit 8838b88a authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #1083 from chang-zhao/master

Update toolbar.js
parents 199aebfe e738f3a7
No related branches found
No related tags found
No related merge requests found
......@@ -243,7 +243,20 @@ function pickerToggle(pickerid,$btn){
} else {
$picker.addClass('a11y').attr('aria-hidden', 'true');
}
$picker.offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3});
var picker_left = pos.left + 3,
picker_width = $picker.width(),
window_width = jQuery(window).width();
if (picker_width > 300) {
$picker.css("max-width", "300");
picker_width = 300;
}
if ((picker_left + picker_width + 40) > window_width) {
picker_left = window_width - picker_width - 40;
}
if (picker_left < 0) {
picker_left = 0;
}
$picker.offset({left: picker_left, top: pos.top+$btn[0].offsetHeight+3});
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment