r.ui.Bubble: Don't position a Bubble off screen.

This commit is contained in:
Ricky Ramirez
2013-10-09 16:48:07 -07:00
parent ebe1f7a9fa
commit 727fe14c2e

View File

@@ -183,7 +183,7 @@ r.ui.Bubble = Backbone.View.extend({
offsetX = this.$parent.outerWidth(true) - this.$el.outerWidth(true)
offsetY = this.$parent.outerHeight(true) + 5
this.$el.css({
left: parentPos.left + offsetX,
left: Math.max(parentPos.left + offsetX, 0),
top: parentPos.top + offsetY - bodyOffset.top
})
} else if (this.$el.is('.anchor-right')) {