Sha256: dd7ba64a33e0ab79b2fd32240f5e609e48e0fc9c998a96d43e0af6151d0e3c63

Contents?: true

Size: 1001 Bytes

Versions: 3

Compression:

Stored size: 1001 Bytes

Contents

#= require_directory ./gridster

# This file enables gridster integration (http://gridster.net/)
# Delete it if you'd rather handle the layout yourself.
# You'll miss out on a lot if you do, but we won't hold it against you.

Dashing.gridsterLayout = (positions) ->
  Dashing.customGridsterLayout = true
  positions = positions.replace(/^"|"$/g, '')
  positions = $.parseJSON(positions)
  widgets = $("[data-row^=]")
  for widget, index in widgets
    $(widget).attr('data-row', positions[index].row)
    $(widget).attr('data-col', positions[index].col)

Dashing.showGridsterInstructions = ->
    data = $(".gridster ul:first").gridster().data('gridster').serialize()
    $('#save-gridster').slideDown()
    $('#gridster-code').text("
      <script type='text/javascript'>\n
      $(function() {\n
      \ \ Dashing.gridsterLayout('#{JSON.stringify(data)}')\n
      });\n
      </script>
    ")


$ ->
  $('#save-gridster').leanModal()

  $('#save-gridster').click ->
    $('#save-gridster').slideUp()

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dashing-1.0 templates/project/assets/javascripts/dashing.gridster.coffee
dashing-0.1.2 templates/project/assets/javascripts/dashing.gridster.coffee
dashing-0.1.0 templates/project/assets/javascripts/dashing.gridster.coffee