=== 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 2013-08-05 14:35:21 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js 2013-08-05 15:06:33 +0000 @@ -7,7 +7,7 @@ dhis2.db.currentShareType; dhis2.db.currentShareId; -// TODO drop at end of list +// TODO proper link hrefs //------------------------------------------------------------------------------ // Document ready @@ -78,22 +78,25 @@ over: dhis2.db.dropOver, out: dhis2.db.dropOut } ); - + $( ".dropItem" ).droppable( { accept: ".item", drop: dhis2.db.dropItem } ); + + $( ".lastDropItem" ).droppable( { + over: dhis2.db.lastDropOver, + out: dhis2.db.lastDropOut + } ); } -dhis2.db.dragStart = function( event, ui ) { - $( this ).css( "opacity", "0.6" ); +dhis2.db.dragStart = function( event, ui ) { $( this ).hide(); dhis2.db.currentItem = $( this ).attr( "id" ); dhis2.db.currentItemPos = $( this ).data( "position" ); } dhis2.db.dragStop = function( event, ui ) { - $( this ).css( "opacity", "1.0" ); $( this ).show(); $( ".dropItem" ).hide(); dhis2.db.currentItem = undefined; @@ -117,6 +120,14 @@ $( "#" + dropItemId ).hide(); } +dhis2.db.lastDropOver = function( event, ui ) { + $( this ).removeClass( "lastDropItem" ).show(); +} + +dhis2.db.lastDropOut = function( event, ui ) { + $( this ).addClass( "lastDropItem" ); +} + dhis2.db.dropItem = function( event, ui ) { var position = parseInt( $( this ).data( "position" ) ); position++; @@ -297,6 +308,8 @@ dhis2.db.renderLinkItem( $d, item.id, item.resources, "Resources", position ); } } ); + + dhis2.db.renderLastDropItem( $d, parseInt( data.items.length - 1 ) ); } else { @@ -310,8 +323,8 @@ dhis2.db.renderLinkItem = function( $d, itemId, contents, title, position ) { var html = - "
  • " + - "
    " + + "
  • " + + "
  • " + "