 
     @snippets      = null
     @shownSnippets = {}
+
+    @loadConfig()
+
+
+  ###*
+    Method loads snippets config from the server.
+    It works if current user is super admin
+  ###
+  loadConfig: ->
+
+    return  unless @isEnabled()
 
     $.ajax
       url      : @buildUrl 'config.json'

  ###
  getSnippet: (name, callback) ->

    return  unless @snippets[name]

    { type, file } = @snippets[name]




  ###*
   * Method loads snippet data and when it's ready emits event to tell that snippet needs to be shown
   *
   * @param {string} name - name of snippet
   * @emits SnippetNeedsToBeShown
  ###
  show: (name) ->

    return kd.log "MarketingController: snippets are not available"  unless @snippets? and @isEnabled()
    return kd.log "MarketingController: couldn't show unknown snippet '#{name}'"  unless @snippets[name]

    @getSnippet name, (snippet) => @emit 'SnippetNeedsToBeShown', snippet


