Sha256: 66b9c4cfa655bf31ce63b0ead57e0d6f765b9b24f855099ba44dc34e72d10217
Contents?: true
Size: 861 Bytes
Versions: 30
Compression:
Stored size: 861 Bytes
Contents
class @Mercury.Palette extends Mercury.Dialog constructor: (@url, @name, @options = {}) -> super build: -> @element = jQuery('<div>', {class: "mercury-palette mercury-#{@name}-palette loading", style: 'display:none'}) @element.appendTo(jQuery(@options.appendTo).get(0) ? 'body') bindEvents: -> Mercury.on 'hide:dialogs', (event, dialog) => @hide() unless dialog == @ super position: (keepVisible) -> @element.css({top: 0, left: 0, display: 'block', visibility: 'hidden'}) position = @button.offset() width = @element.width() position.left = position.left - width + @button.width() if position.left + width > jQuery(window).width() @element.css { top: position.top + @button.height() left: position.left display: if keepVisible then 'block' else 'none' visibility: 'visible' }
Version data entries
30 entries across 30 versions & 3 rubygems