diff --git a/app/views/invitations/edit.html.haml b/app/views/invitations/edit.html.haml
index 42c526137..92569452d 100644
--- a/app/views/invitations/edit.html.haml
+++ b/app/views/invitations/edit.html.haml
@@ -1,7 +1,7 @@
= javascript_include_tag "validation"
:javascript
$(function() {
- $('#user_new [title]').tipsy({trigger: 'focus', gravity: 'w'});
+ $('#user_new [title]').tipsy({trigger: 'focus', gravity: ($('html').attr('dir') == 'rtl') ? 'e' : 'w'});
$("#user_username").focus();
});
diff --git a/app/views/invitations/new.html.haml b/app/views/invitations/new.html.haml
index 2cd92a0e4..28b3d56fd 100644
--- a/app/views/invitations/new.html.haml
+++ b/app/views/invitations/new.html.haml
@@ -1,6 +1,6 @@
:javascript
$(function() {
- $('#new_user [title]').tipsy({trigger: 'focus', gravity: 'w'});
+ $('#new_user [title]').tipsy({trigger: 'focus', gravity: ($('html').attr('dir') == 'rtl') ? 'e' : 'w'});
$("#user_email").focus();
});
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index a73371500..9a69d01e0 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -3,7 +3,7 @@
-# the COPYRIGHT file.
!!!
-%html{:lang => I18n.locale.to_s}
+%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
%head
%meta{:charset => 'utf-8'}
diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml
index f4816f721..66e6cbe13 100644
--- a/app/views/layouts/application.mobile.haml
+++ b/app/views/layouts/application.mobile.haml
@@ -3,7 +3,7 @@
-# the COPYRIGHT file.
!!!
-%html{:lang => I18n.locale.to_s}
+%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
%head
%title
DIASPORA*
diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml
index 51f75571e..8873d84ee 100644
--- a/app/views/registrations/new.html.haml
+++ b/app/views/registrations/new.html.haml
@@ -2,7 +2,7 @@
:javascript
$(function() {
- $('#user_new [title]').tipsy({trigger: 'focus', gravity: 'w'});
+ $('#user_new [title]').tipsy({trigger: 'focus', gravity: ($('html').attr('dir') == 'rtl')? 'e' : 'w'});
$("#user_username").focus();
});
diff --git a/public/javascripts/view.js b/public/javascripts/view.js
index 6a2afb251..5da8139e9 100644
--- a/public/javascripts/view.js
+++ b/public/javascripts/view.js
@@ -152,7 +152,7 @@ var View = {
addAspect: {
bind: function() {
$(".add_aspect_button", "#aspect_nav").tipsy({
- gravity:"w"
+ gravity: ($('html').attr('dir') == 'rtl')? "e" : "w"
});
}
},