overleaf/services/web/public/coffee/ide/LinkSharingOnboardingController.coffee

22 lines
613 B
CoffeeScript
Raw Normal View History

2017-11-09 09:28:11 -05:00
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', () ->
2017-11-09 09:28:11 -05:00
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'
2017-11-09 09:28:11 -05:00
})