Sha256: 3c7d5876dd8e85ff22c7d129332a2e7cbe6f33c932a1fc2ba6383db8927fcdcc

Contents?: true

Size: 595 Bytes

Versions: 5

Compression:

Stored size: 595 Bytes

Contents

@init_sortable_menu = ->
  $menu = $("#menu")
  return  if $menu.length == 0
  $menu.sortable(
    items: "> *:not(#menu_reorder, #menu_reorder_done)"
    axis: "x"
    cursor: "crosshair"
    connectWith: ".nested"
    update: ->
      $.post "/<%= Refinery::Core.backend_route %>/update_menu_positions", $menu.sortable("serialize",
        key: "menu[]"
        expression: /plugin_([\w]*)$/
      )
  ).tabs()
  $menu.sortable "disable"
  $menu.find("#menu_reorder").click (e) ->
    trigger_reordering e, true

  $menu.find("#menu_reorder_done").click (e) ->
    trigger_reordering e, false

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
refinerycms-core-2.1.5 app/assets/javascripts/refinery/sortable_menu.js.coffee.erb
refinerycms-core-2.1.4 app/assets/javascripts/refinery/sortable_menu.js.coffee.erb
refinerycms-core-2.1.3 app/assets/javascripts/refinery/sortable_menu.js.coffee.erb
refinerycms-core-2.1.2 app/assets/javascripts/refinery/sortable_menu.js.coffee.erb
refinerycms-core-2.1.1 app/assets/javascripts/refinery/sortable_menu.js.coffee.erb