mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-11 05:46:37 +01:00
23 lines
499 B
CoffeeScript
23 lines
499 B
CoffeeScript
class Morris.Hover
|
|
# Displays contextual information in a floating HTML div.
|
|
#
|
|
constructor: (options = {}) ->
|
|
@options = $.extend {}, Morris.Hover.defaults, options
|
|
@el = $ "<div class='#{@options.class}'></div>"
|
|
@el.hide()
|
|
|
|
@defaults:
|
|
class: 'morris-popup'
|
|
allowOverflow: false
|
|
|
|
show: (x, y, data) ->
|
|
if typeof @options.content is 'function'
|
|
@el.html @options.content(data)
|
|
else
|
|
@el.html @options.content
|
|
@el.show()
|
|
|
|
hide: ->
|
|
@el.hide()
|
|
|