PHP Classes

File: assets/js/sortable-images.js

Recommend this page to a friend!
  Classes of Goffy G  >  wgGallery  >  assets/js/sortable-images.js  >  Download  
File: assets/js/sortable-images.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: wgGallery
Image gallery module for XOOPS CMS
Author: By
Last change:
Date: 1 year ago
Size: 1,259 bytes
 

Contents

Class file image Download
// Jquery function for order fields
// When the page is loaded define the current order and items to reorder
$(document).ready( function(){
/* script for sortable list */
	var ns = $('ol.sortable').nestedSortable({
		forcePlaceholderSize: true,
		handle: 'div',
		helper:	'clone',
		items: 'li',
		opacity: .6,
		placeholder: 'placeholder',
		revert: 250,
		tabSize: 25,
		tolerance: 'pointer',
		toleranceElement: '> div',
		maxLevels: 1,
		isTree: false,
		expandOnHover: 700,
		startCollapsed: false,
		excludeRoot: true,
		rootID:"0"
	});

	$('.disclose').on('click', function() {
		$(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
		$(this).toggleClass('ui-icon-plusthick').toggleClass('ui-icon-minusthick');
	});

/* Call the container items to reorder fields */
  $( function() {
    $( "ol.sortable" ).nestedSortable({
			update: function(event, ui) {
				var list = $(this).nestedSortable( 'serialize');
				$.post( 'images.php?op=order', list );
			},
			receive: function(event, ui) {
				var list = $(this).nestedSortable( 'serialize');                    
				$.post( 'images.php?op=order', list );                      
			}
		});
    $( "ol.sortable" ).disableSelection();
  } );
});
For more information send a message to info at phpclasses dot org.