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

Version Path
kiteditor-1.0.25 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.24 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.23 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.22 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.21 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.20 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.19 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.18 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.17 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.16 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.14 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.13 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.11 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.10 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.9 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.8 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.7 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.6 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.5 vendor/assets/javascripts/mercury/palette.js.coffee
kiteditor-1.0.4 vendor/assets/javascripts/mercury/palette.js.coffee