summaryrefslogtreecommitdiff
path: root/includes/media_reorder.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/media_reorder.php')
-rw-r--r--includes/media_reorder.php30
1 files changed, 13 insertions, 17 deletions
diff --git a/includes/media_reorder.php b/includes/media_reorder.php
index f30ece47f6..8200ca4617 100644
--- a/includes/media_reorder.php
+++ b/includes/media_reorder.php
@@ -164,24 +164,20 @@ require_once WT_ROOT.'includes/functions/functions_print_facts.php';
}
?>
</ul>
-<?php
-?>
- <script type="text/javascript">
- // <![CDATA[
- new Effect.BlindDown('reorder_media_list', {duration: .5});
- Sortable.create('reorder_media_list',
- {
- scroll:window,
- onUpdate : function() {
- inputs = $('reorder_media_list').getElementsByTagName('input');
- for (var i = 0; i < inputs.length; i++) {
- inputs[i].value = i;
+ <?php echo WT_JS_START; ?>
+ jQuery(document).ready(function() {
+ jQuery("#reorder_media_list").sortable({forceHelperSize: true, forcePlaceholderSize: true, opacity: 0.7, cursor: 'move', axis: 'y'});
+
+ //-- update the order numbers after drag-n-drop sorting is complete
+ jQuery('#reorder_media_list').bind('sortupdate', function(event, ui) {
+ jQuery('#'+jQuery(this).attr('id')+' input').each(
+ function (index, value) {
+ value.value = index+1;
}
- }
- }
- );
- // ]]>
- </script>
+ );
+ });
+ });
+ <?php echo WT_JS_END; ?>
<center>
<?php
if (WT_USER_IS_ADMIN) {