diff --git a/r2/r2/public/static/css/reddit.less b/r2/r2/public/static/css/reddit.less index a98c2e578..d1c53b3ee 100755 --- a/r2/r2/public/static/css/reddit.less +++ b/r2/r2/public/static/css/reddit.less @@ -1060,6 +1060,24 @@ a.author { margin-right: 0.5em; } } } + &.anchor-top-centered { + &:before, &:after { + left: 50%; + margin-left: -9px; + border: 9px solid transparent; + } + + &:before { + top: -19px; + border-bottom-color: gray; + } + + &:after { + top: -18px; + border-bottom-color: white; + } + } + &.anchor-right { &:before, &:after { top: 8px; diff --git a/r2/r2/public/static/js/ui.js b/r2/r2/public/static/js/ui.js index 3f28b65b1..8029381f5 100644 --- a/r2/r2/public/static/js/ui.js +++ b/r2/r2/public/static/js/ui.js @@ -179,7 +179,7 @@ r.ui.Bubble = Backbone.View.extend({ var parentPos = this.$parent.offset(), bodyOffset = $('body').offset(), offsetX, offsetY - if (this.$el.is('.anchor-top')) { + if (this.$el.is('.anchor-top') || this.$el.is('.anchor-top-centered')) { offsetX = this.$parent.outerWidth(true) - this.$el.outerWidth(true) offsetY = this.$parent.outerHeight(true) + 5 this.$el.css({ @@ -265,7 +265,7 @@ r.ui.Bubble = Backbone.View.extend({ } var animProp, animOffset - if (this.$el.is('.anchor-top')) { + if (this.$el.is('.anchor-top') || this.$el.is('.anchor-top-centered')) { animProp = 'top' animOffset = '-=5' } else if (this.$el.is('.anchor-right')) {