← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16143: Dashboard, smoother drag and drop

 

------------------------------------------------------------
revno: 16143
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-07-15 23:26:02 +0200
message:
  Dashboard, smoother drag and drop
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js	2014-07-15 20:49:30 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js	2014-07-15 21:26:02 +0000
@@ -109,8 +109,7 @@
 	
 	$( ".item" ).droppable( {
 		accept: ".item",
-		over: dhis2.db.dropOver,
-		out: dhis2.db.dropOut
+		over: dhis2.db.dropOver
 	} );
 
 	$( ".dropItem" ).droppable( {
@@ -143,20 +142,15 @@
 
 dhis2.db.dropOver = function( event, ui ) 
 {
+	$( ".dropItem" ).not( "#dropLast" ).hide();
 	var itemId = $( this ).attr( "id" );
 	var dropItemId = "drop-" + itemId;
 	$( "#" + dropItemId ).show();
 }
 
-dhis2.db.dropOut = function( event, ui ) 
-{
-	var itemId = $( this ).attr( "id" );
-	var dropItemId = "drop-" + itemId;
-	$( "#" + dropItemId ).hide();
-}
-
 dhis2.db.lastDropOver = function( event, ui ) 
 {
+	$( ".dropItem" ).not( "#dropLast" ).hide();
 	$( this ).removeClass( "blankDropItem" ).css( "display", "block" );
 }