comicpress-core/js/Storyline.js

25 lines
614 B
JavaScript
Raw Normal View History

2009-11-01 18:15:59 +00:00
var Storyline = {};
Storyline.get_order = function() {
var order = []
jQuery('#storyline-sorter .cp-category-info').each(function() {
var matches = this.className.match(/category-([0-9\/]+)/);
if (matches) { order.push(matches[1]); }
});
jQuery('input[name=cp[storyline_order]]').attr('value', order.join(','));
};
Storyline.setup = function() {
jQuery('.cp-children').sortable({
handle: 'span',
cursor: 'move',
placeholder: 'placeholder',
forcePlaceholderSize: true,
opacity: 0.4,
2009-11-01 19:04:15 +00:00
stop: function(e, ui) {
2009-11-01 18:15:59 +00:00
Storyline.get_order();
}
});
};
jQuery(function() { Storyline.get_order(); });