Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

r.ui.Bubble: Default to anchor-right logic.

  • Loading branch information...
commit 86265bfe481a345bb3080f04b8389be5278692f0 1 parent 2379a24
@andre-d andre-d authored kemitche committed
Showing with 11 additions and 11 deletions.
  1. +11 −11 r2/r2/public/static/js/ui.js
View
22 r2/r2/public/static/js/ui.js
@@ -192,14 +192,6 @@ r.ui.Bubble = Backbone.View.extend({
left: parentPos.left,
top: parentPos.top + offsetY - bodyOffset.top
})
- } else if (this.$el.is('.anchor-right')) {
- offsetX = 16
- offsetY = 0
- parentPos.right = $(window).width() - parentPos.left
- this.$el.css({
- right: parentPos.right + offsetX,
- top: parentPos.top + offsetY - bodyOffset.top
- })
} else if (this.$el.is('.anchor-right-fixed')) {
offsetX = 32
offsetY = 0
@@ -218,6 +210,14 @@ r.ui.Bubble = Backbone.View.extend({
left: parentPos.left + offsetX,
top: parentPos.top + offsetY - bodyOffset.top
})
+ } else { // anchor-right
+ offsetX = 16
+ offsetY = 0
+ parentPos.right = $(window).width() - parentPos.left
+ this.$el.css({
+ right: parentPos.right + offsetX,
+ top: parentPos.top + offsetY - bodyOffset.top
+ })
}
},
@@ -281,15 +281,15 @@ r.ui.Bubble = Backbone.View.extend({
if (this.$el.is('.anchor-top') || this.$el.is('.anchor-top-centered') || this.$el.is('.anchor-top-left')) {
animProp = 'top'
animOffset = '-=5'
- } else if (this.$el.is('.anchor-right')) {
- animProp = 'right'
- animOffset = '-=5'
} else if (this.$el.is('.anchor-right-fixed')) {
animProp = 'right'
animOffset = '-=5'
} else if (this.$el.is('.anchor-left')) {
animProp = 'left'
animOffset = '+=5'
+ } else { // anchor-right
+ animProp = 'right'
+ animOffset = '-=5'
}
var curOffset = this.$el.css(animProp)
Please sign in to comment.
Something went wrong with that request. Please try again.