   class Dialog
     constructor: (@settings, files, tab) ->
 
-      if files 
+      if files
         unless $.isArray(files)
           files = [files]
       else
         files = []
 
       @dfd = $.Deferred()
-      @dfd.always => 
+      @dfd.always =>
         @__closeDialog()
 
       @content = $(tpl('dialog'))
         .hide()
         .appendTo('body')
         .addClass(if @settings.multiple then 'uploadcare-dialog-multiple')
-      
+
       @files = new utils.CollectionOfPromises()
 
       @__bind()


  currentDialogPr = null

  ns.isDialogOpened = -> 
    currentDialogPr != null

  ns.closeDialog = ->

      return promise

    apiForTab: (tabName) ->
      api =
        avalibleTabs: @settings.tabs
        fileColl: @files.readOnly()
        onSwitched: $.Callbacks()
