Skip to content

Commit

Permalink
Fix joyride RTL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Humphreys committed Dec 19, 2013
1 parent 637630e commit 99668af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/layouts/default.html
@@ -1,6 +1,6 @@
<!doctype html>
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
<html class="no-js" lang="en">
<html class="no-js" lang="en" dir="rtl">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Expand Down
29 changes: 16 additions & 13 deletions js/foundation/foundation.joyride.js
Expand Up @@ -426,26 +426,29 @@
}

if (!/body/i.test(this.settings.$target.selector)) {

if (this.bottom()) {
var leftOffset = this.settings.$target.offset().left;
if (Foundation.rtl) {
leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset;
if (this.rtl) {
this.settings.$next_tip.css({
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
} else {
this.settings.$next_tip.css({
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
left: this.settings.$target.offset().left});
}
this.settings.$next_tip.css({
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
left: leftOffset});

this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');

} else if (this.top()) {
var leftOffset = this.settings.$target.offset().left;
if (Foundation.rtl) {
leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset;
if (this.rtl) {
this.settings.$next_tip.css({
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
} else {
this.settings.$next_tip.css({
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
left: this.settings.$target.offset().left});
}
this.settings.$next_tip.css({
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
left: leftOffset});

this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');

Expand Down

0 comments on commit 99668af

Please sign in to comment.