Sha256: 6afd1097c73af618bbd5e9bcd294a8e15c205e22f7f9b0a9a603b06f9eac0a12

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

#= require 'draggable'

if OverlayMe.mustLoad()

  # create elements
  OverlayMe.menu_box = new OverlayMe.Draggable { id: 'overlay_me_dev_tools_menu' }, { default_css: { left: document.documentElement.clientWidth-300+'px', top: '0px' } }
  drag_me_line = (new Backbone.View).make 'div', { class: 'drag-me' }, 'Drag me'
  OverlayMe.Menu = (new Backbone.View).make 'ul'

  # stack them together
  $(OverlayMe.menu_box.el).append drag_me_line
  $(OverlayMe.menu_box.el).append OverlayMe.Menu

  # add it to the page
  $('body').append OverlayMe.menu_box.render()

  # add listeners
  $(drag_me_line).bind 'mousedown', (event) =>
    OverlayMe.menu_box.toggleMove(event)
  $(window).bind 'mouseup', (event) =>
    OverlayMe.menu_box.endMove(event)
  $(OverlayMe.menu_box).bind 'toggle:visibility', (event) =>
    if $(OverlayMe.menu_box.el).css('visibility') == 'visible'
      css = { visibility: 'hidden' }
    else
      css = { visibility: 'visible' }
    $(OverlayMe.menu_box.el).css(css)
    OverlayMe.menu_box.saveCss()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
overlay_me-0.12.0 javascripts/menu.js.coffee