forked from refinery/refinerycms
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3221ab5
commit 1e2c2d7
Showing
3 changed files
with
22 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
*= require ./admin | ||
*= require ./submenu | ||
*= require ./interface | ||
*= require ./sortable_menu | ||
*/ |
21 changes: 21 additions & 0 deletions
21
core/app/assets/javascripts/refinery/sortable_menu.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@init_sortable_menu = -> | ||
$menu = $("#menu") | ||
return if $menu.length == 0 | ||
$menu.sortable( | ||
axis: "x" | ||
cursor: "crosshair" | ||
connectWith: ".nested" | ||
update: -> | ||
$.post "/refinery/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 | ||
|
||
$menu.find("> a").corner "top 5px" |