diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index d5023f96d0..27e8094bf4 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -171,6 +171,16 @@ define [ , 200 ) + # Count the first 'doc:opened' as a sign that the ide is loaded + # and broadcast a message. This is a good event to listen for + # if you want to wait until the ide is fully loaded and initialized + _loaded = false + $scope.$on 'doc:opened', () -> + if _loaded + return + $scope.$broadcast('ide:loaded') + _loaded = true + DARK_THEMES = [ "ambiance", "chaos", "clouds_midnight", "cobalt", "idle_fingers", "merbivore", "merbivore_soft", "mono_industrial", "monokai", diff --git a/services/web/public/coffee/ide/LinkSharingOnboardingController.coffee b/services/web/public/coffee/ide/LinkSharingOnboardingController.coffee index 7b54328bd9..7e945f1b6a 100644 --- a/services/web/public/coffee/ide/LinkSharingOnboardingController.coffee +++ b/services/web/public/coffee/ide/LinkSharingOnboardingController.coffee @@ -2,7 +2,6 @@ define [ "base" ], (App) -> App.controller "LinkSharingOnboardingController", ($scope, $timeout, event_tracking) -> - $scope._shown = false popover = angular.element('#onboarding-linksharing') popover.hide() @@ -11,8 +10,8 @@ define [ $scope.onboarding.linkSharing = 'dismissed' event_tracking.sendMB "shown-linksharing-onboarding" - $scope.$on 'doc:opened', () -> - return if $scope._shown + $scope.$on 'ide:loaded', () -> + console.log ">> woot" shareBtn = angular.element('#shareButton') offset = shareBtn.offset() popover.show() @@ -21,4 +20,3 @@ define [ top: offset.top + 8 + shareBtn.height(), left: offset.left }) - $scope.shown = true