function drag(e) {
	// drag data
	let target = e.target;
	let action = e.target.id.substr(0, 12);
	if (action === 'sambaimagexx') {
		target = e.target.parentNode;
		action = target.id.substr(0, 12);
	}
	let dragUser = target.id.substr(13);
	let dragSource = target.parentNode.id;
	e.dataTransfer.setData('source', dragSource);

	// page: Samba shares
	switch (action) {
		case 'standarduser':
			e.dataTransfer.setData('type', 'standarduser');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'useringroupx':
			e.dataTransfer.setData('type', 'useringroup');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'sambagroupxx':
			e.dataTransfer.setData('type', 'sambagroup');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'sambaguestxx':
			e.dataTransfer.setData('type', 'sambaguest');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'sambauserxxx':
			// save user and group of dragged object
			e.dataTransfer.setData('user', dragUser);
			e.dataTransfer.setData('group', target.parentNode.id.substr(13));
			break;
		case 'sambaimagexx':
			alert('UNUSED');
			// save user and group of dragged object
			e.dataTransfer.setData('user', dragUser);
			e.dataTransfer.setData('group', target.parentNode.parentNode.id.substr(13));
			break;
	}
}
/* drag & drop for Shares and Users tab */
drag & drop for Shares and Users tab
drag & drop for Shares and Users tab
function drag(e) {
	let target = e.target;
	let action = e.target.id.substr(0, 12);
	if (action === 'sambaimagexx') {
		target = e.target.parentNode;
		action = target.id.substr(0, 12);
	}
	let dragUser = target.id.substr(13);
	let dragSource = target.parentNode.id;
	e.dataTransfer.setData('source', dragSource);
	switch (action) {
		case 'standarduser':
			e.dataTransfer.setData('type', 'standarduser');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'useringroupx':
			e.dataTransfer.setData('type', 'useringroup');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'sambagroupxx':
			e.dataTransfer.setData('type', 'sambagroup');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'sambaguestxx':
			e.dataTransfer.setData('type', 'sambaguest');
			e.dataTransfer.setData('name', dragUser);
			break;
		case 'sambauserxxx':
			e.dataTransfer.setData('user', dragUser);
			e.dataTransfer.setData('group', target.parentNode.id.substr(13));
			break;
		case 'sambaimagexx':
			alert('UNUSED');
			e.dataTransfer.setData('user', dragUser);
			e.dataTransfer.setData('group', target.parentNode.parentNode.id.substr(13));
			break;
	}
}
function drag ( e ) { let target = e . target ; let action = e . target . id . substr ( 0 , 12 ) ; if ( action === 'sambaimagexx' ) { target = e . target . parentNode ; action = target . id . substr ( 0 , 12 ) ; } let dragUser = target . id . substr ( 13 ) ; let dragSource = target . parentNode . id ; e . dataTransfer . setData ( 'source' , dragSource ) ; switch ( action ) { case 'standarduser' : e . dataTransfer . setData ( 'type' , 'standarduser' ) ; e . dataTransfer . setData ( 'name' , dragUser ) ; break ; case 'useringroupx' : e . dataTransfer . setData ( 'type' , 'useringroup' ) ; e . dataTransfer . setData ( 'name' , dragUser ) ; break ; case 'sambagroupxx' : e . dataTransfer . setData ( 'type' , 'sambagroup' ) ; e . dataTransfer . setData ( 'name' , dragUser ) ; break ; case 'sambaguestxx' : e . dataTransfer . setData ( 'type' , 'sambaguest' ) ; e . dataTransfer . setData ( 'name' , dragUser ) ; break ; case 'sambauserxxx' : e . dataTransfer . setData ( 'user' , dragUser ) ; e . dataTransfer . setData ( 'group' , target . parentNode . id . substr ( 13 ) ) ; break ; case 'sambaimagexx' : alert ( 'UNUSED' ) ; e . dataTransfer . setData ( 'user' , dragUser ) ; e . dataTransfer . setData ( 'group' , target . parentNode . parentNode . id . substr ( 13 ) ) ; break ; } }
drag & drop for Shares and Users tab
drag & drop for Shares and Users tab
// drag data // page: Samba shares // save user and group of dragged object // save user and group of dragged object