 
 
   ###*
-    Modal view with overlay option for Spark Framework.
+    Modal view with overlay option for Spark Framework. By default modal will be
+    appended to document body and it will have an overlay. When overlay clicked
+    the modal will be destroyed. You should pass title and content params of the
+    modal in your options. You can also customize buttons. See `@createButtons_`
+    for more information.
 
     @constructor
     @export

      @removeFromDocument()


  @Buttons        =
    YES           : [ 'Yes' ]
    NO            : [ 'No'  ]
    YES_NO        : [ 'Yes', 'No' ]
    YES_NO_CANCEL : [ 'Yes', 'No', 'Cancel' ]


  @ButtonCssClasses =
    Yes    : 'green'
    No     : 'red'
    Cancel : 'grey'

    else
      buttons.forEach (options) =>
        options.renderTo = @buttonsContainer
        @buttons[options.title] = new spark.components.Button options


  ###*
    Sets overlay for modal. Overlay and modal will be destroyed when overlay
    clicked if `removeOnOverlayClick` options is passed true in modal options.

    @private
  ###
  setOverlay_: ->
    @overlay = new spark.components.Overlay
      removeOnClick: @getOptions().removeOnOverlayClick

