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

27 lines
729 B
CoffeeScript
Raw Normal View History

2017-09-27 11:35:28 -04:00
define [
"base"
], (App) ->
2017-09-28 08:02:16 -04:00
App.controller "AutoCompileOnboardingController", ($scope, event_tracking) ->
recompileBtn = angular.element('#recompile')
popover = angular.element('#onboarding-autocompile')
{ top, left } = recompileBtn.offset()
2017-09-28 07:16:02 -04:00
# If pdf panel smaller than recompile button + popover, show to left.
# Otherwise show to right
if $scope.ui.pdfWidth < 475
$scope.placement = 'left'
popover.offset({
top: top,
2017-09-28 06:55:20 -04:00
left: left - popover.width()
})
else
$scope.placement = 'right'
2017-09-29 05:53:06 -04:00
popover.offset({
top: top,
2017-09-28 06:55:20 -04:00
left: left + recompileBtn.width()
})
2017-09-27 12:20:06 -04:00
$scope.dismiss = () ->
$scope.onboarding.autoCompile = 'dismissed'
2017-11-08 06:01:36 -05:00
event_tracking.sendMB "shown-autocompile-onboarding-2"