overleaf/services/web/public/coffee/ide/LinkSharingOnboardingController.coffee
Shane Kilkelly 42c0974671 Place the linksharing popover from the right, not the left.
This ensures the popover reflows properly with window resize.
2017-11-10 12:05:12 +00:00

21 lines
613 B
CoffeeScript

define [
"base"
], (App) ->
App.controller "LinkSharingOnboardingController", ($scope, $timeout, event_tracking) ->
popover = angular.element('#onboarding-linksharing')
popover.hide()
$scope.dismiss = () ->
$scope.onboarding.linkSharing = 'dismissed'
event_tracking.sendMB "shown-linksharing-onboarding"
$scope.$on 'ide:loaded', () ->
shareBtn = angular.element('#shareButton')
offset = shareBtn.offset()
popover.show()
$scope.placement = 'bottom'
popover.css({
top: '' + (2) + 'px',
right: '' + (window.innerWidth - offset.left - (shareBtn.width() * 1.5) ) + 'px'
})