 
   initialize: ->
     @addToCollection = new OwnChannelCollection
+    @tooltip = new Tooltip($)
 
   onRender: ->
     @renderAddToChannel()

      e.preventDefault()
      # TODO when refactoring this view, move parent.remote code to clientcontroller
      parent.remote.hide()


class Tooltip
  constructor: ($) ->
    @$ = $
    @_shouldShowTooltip = true

  showTooltip: ->
    return if ( ! @_shouldShowTooltip )

    @$('.fact-wheel').tooltip(
      title: "What's your opinion?",
      trigger: "manual"
    ).tooltip('show');

  close: ->
    @_shouldShowTooltip = false
    $(window).off 'resize.whatsyouropinion'
    @$('.fact-wheel').off 'click.whatsyouropinion'
    @$('.js-opinion-animation').hide();
    @$('.fact-wheel').tooltip('destroy')

  render: ->
    @$('.fact-wheel').on 'click.whatsyouropinion', ->
      @close()

      if FactlinkApp.guided
        $('#submit').tooltip(
          title: "Great! Click here to finish",
          trigger: "manual"
        ).tooltip("show");

    $(window).on 'resize.whatsyouropinion', =>
      @showTooltip();

    @showTooltip()


class window.FactsNewView extends Backbone.Marionette.ItemView
