Skip to content

Instantly share code, notes, and snippets.

@jdorrance
Last active December 26, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdorrance/7124492 to your computer and use it in GitHub Desktop.
Save jdorrance/7124492 to your computer and use it in GitHub Desktop.
$("#containerBottom_tabs .ui-tabs-nav").sortable
update: (event, ui) ->
thisID = $(ui.item).attr("nodePath")
thisParent = $(ui.item).attr("parentPath")
next = $(ui.item).next().attr("nodePath")
params = "cmd=movePage" + "&_charset_=utf-8" + "&srcPath=" + thisID
params += "&destParentPath=" + thisParent += "&before="
if(next?)
params += next
if(thisID? and thisParent?)
response = CQ.HTTP.post("/bin/wcmcommand?" + params)
ok = response.headers.Status and response.headers.Status is "200"
if(!ok)
$("#containerBottom_tabs .ui-tabs-nav").sortable("destroy")
$("#tabsError").dialog()
if(ok)
console.log("moved successfully!" + ok)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment