wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.js
/**
	 * Determine the sortable depth of a repeater item and either return it or apply it
	 * 
	 * @param ui The 'ui' argument provided to jQuery UI sortable events
	 * @param maxDepth Maximum allowed depth
	 * @param updateNow Specify true to apply the determined depth now or false to just return it. 
	 * @returns {number} Depth integer value between 0 and maxDepth
	 * 
	 */
Determine the sortable depth of a repeater item and either return it or apply it

@param ui The 'ui' argument provided to jQuery UI sortable events
@param maxDepth Maximum allowed depth
@param updateNow Specify true to apply the determined depth now or false to just return it.
@returns {number} Depth integer value between 0 and maxDepth
Determine the sortable depth of a repeater item and either return it or apply it @param ui The ' ui ' argument provided to jQuery UI sortable events @param maxDepth Maximum allowed depth @param updateNow Specify true to apply the determined depth now or false to just return it . @returns { number } Depth integer value between 0 and maxDepth
function sortableDepth(ui, maxDepth, updateNow) {
		var $wrap = ui.item.children('.InputfieldContent').children('.Inputfields').children('.InputfieldRepeaterItemDepth');
		var $depth = $wrap.find('input');
		var depth = -1;
		var prevDepth = parseInt($depth.val());
		var left = ui.position.left;
		if(left < 0) {
			depth = prevDepth - Math.round(Math.abs(left) / depthSize);
		} else {
			depth = Math.round(left / depthSize) + prevDepth;
		}
		if(updateNow) {
			depth = setItemDepth(ui.item, depth, maxDepth);
			ui.item.children('.InputfieldHeader').removeClass('ui-state-error');
		}
		return depth;
	}
function sortableDepth ( ui , maxDepth , updateNow ) { var $wrap = ui . item . children ( '.InputfieldContent' ) . children ( '.Inputfields' ) . children ( '.InputfieldRepeaterItemDepth' ) ; var $depth = $wrap . find ( 'input' ) ; var depth = - 1 ; var prevDepth = parseInt ( $depth . val ( ) ) ; var left = ui . position . left ; if ( left < 0 ) { depth = prevDepth - Math . round ( Math . abs ( left ) / depthSize ) ; } else { depth = Math . round ( left / depthSize ) + prevDepth ; } if ( updateNow ) { depth = setItemDepth ( ui . item , depth , maxDepth ) ; ui . item . children ( '.InputfieldHeader' ) . removeClass ( 'ui-state-error' ) ; } return depth ; }
Determine the sortable depth of a repeater item and either return it or apply it
Determine the sortable depth of a repeater item and either return it or apply it
// console.log('decrease depth to: ' + depth); // console.log('increase depth to: ' + depth);