Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
r.ui.Bubble: Default to anchor-right logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-d authored and kemitche committed Feb 25, 2014
1 parent 2379a24 commit 86265bf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions r2/r2/public/static/js/ui.js
Expand Up @@ -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
Expand All @@ -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
})
}
},

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 86265bf

Please sign in to comment.