Skip to content
Snippets Groups Projects
Commit 8cc3a372 authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Fix help tip popup for RTL display

parent e001acaf
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,16 @@ jQuery(function() {
var tip_shadow = $('<div>').addClass('tip_shadow');
var tip_content = $('<div>').addClass('tip_content').load(url, function() {
tip_content.prepend('<a href="#" class="tip_close"><i class="icon-remove-circle"></i></a>').append(tip_arrow);
if ($(window).width() < tip_content.outerWidth() + the_tip.position().left) {
console.log(x_pos, tip_content.outerWidth(), elem.width());
var width = $(window).width(),
rtl = $('html').hasClass('rtl'),
size = tip_content.outerWidth(),
left = the_tip.position().left,
left_room = left - size,
right_room = width - size - left,
flip = rtl
? (left_room > 0 && left_room > right_room)
: (right_room < 0 && left_room > right_room);
if (flip) {
the_tip.css({'left':x_pos-tip_content.outerWidth()-elem.width()-32+'px'});
tip_box.addClass('right');
tip_arrow.addClass('flip-x');
......@@ -105,7 +113,16 @@ jQuery(function() {
tip_timer = setTimeout(function() {
$('.tip_box').remove();
$('body').append(the_tip.hide().fadeIn());
if ($(window).width() < tip_content.outerWidth() + the_tip.position().left) {
var width = $(window).width(),
rtl = $('html').hasClass('rtl'),
size = tip_content.outerWidth(),
left = the_tip.position().left,
left_room = left - size,
right_room = width - size - left,
flip = rtl
? (left_room > 0 && left_room > right_room)
: (right_room < 0 && left_room > right_room);
if (flip) {
the_tip.css({'left':x_pos-tip_content.outerWidth()-40+'px'});
tip_box.addClass('right');
tip_arrow.addClass('flip-x');
......
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