Skip to content

Instantly share code, notes, and snippets.

@almaron
Created November 2, 2012 12:30
Show Gist options
  • Save almaron/4001049 to your computer and use it in GitHub Desktop.
Save almaron/4001049 to your computer and use it in GitHub Desktop.
script
(function() {
$(document).ready(function() {
$('#sortable').nestedSortable({
forcePlaceholderSize: true,
placeholder: 'placeholder',
items: 'li',
tolerance: 'pointer',
revert: 250,
tabSize: 25,
toleranceElement: '> div',
helper: 'clone',
isTree: true,
expandOnHover: 700,
startCollapsed: true,
rootID: null
});
$('.form_header').click(function() {
$(this).toggleClass('form_head_active');
return $(this).next('.form_div').slideToggle(300).toggleClass('form_div_active');
});
return $('#page_save').click(function() {
var serial;
serial = $('#sortable').nestedSortable('serialize');
$('.page_save_span').fadeToggle(100);
return $.get('/pages.js', {
'hash': serial
}, function(data) {
$.globalEval(data);
return $('.page_save_span').fadeToggle(100);
});
});
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment