Last active
December 26, 2015 08:49
-
-
Save jdorrance/7124492 to your computer and use it in GitHub Desktop.
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
$("#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