← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16947: Updates to messaging interface. Highlight selected messages, indeterminate checkbox state for par...

 

------------------------------------------------------------
revno: 16947
committer: Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-10-03 13:32:55 +0200
message:
  Updates to messaging interface. Highlight selected messages, indeterminate checkbox state for partially selected list, retain selection of messages when firing action.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisCheckboxMenu.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisCheckboxMenu.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisCheckboxMenu.js	2014-10-02 14:41:11 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisCheckboxMenu.js	2014-10-03 11:32:55 +0000
@@ -130,23 +130,18 @@
             }
 
             el.click( function() {
-                var checked = getCheckedValues( $checkboxContainer );
-
-                $checkbox.removeAttr( "checked" );
-                $slaveCheckboxes.removeAttr( "checked" );
-
-                return window[ el.action ]( checked );
+                return window[ el.action ]( getCheckedValues( $checkboxContainer ) );
             });
         });
 
         $checkbox.click( function( event ) {
             if( this.checked )
             {
-                $slaveCheckboxes.attr( "checked", "checked" );
+                $slaveCheckboxes.attr( "checked", "checked" ).trigger( "change" );
             }
             else
             {
-                $slaveCheckboxes.removeAttr( "checked" );
+                $slaveCheckboxes.removeAttr( "checked" ).trigger( "change" );
             }
             event.stopPropagation();
         });
@@ -156,14 +151,17 @@
 
             if( checked.length < 1 )
             {
+                $checkbox.prop( "indeterminate", false );
                 $checkbox.removeAttr( "checked" );
             }
             else if( checked.length > 0 && checked.length < $slaveCheckboxes.length )
             {
                 $checkbox.removeAttr( "checked" );
+                $checkbox.prop( "indeterminate", true );
             }
             else
             {
+                $checkbox.prop( "indeterminate", false );
                 $checkbox.attr( "checked", "checked" );
             }
         });

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2014-10-01 10:11:08 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2014-10-03 11:32:55 +0000
@@ -100,10 +100,14 @@
     for( var i = 0; i < messageUids.length; i++ )
     {
         messages.find( "[name='" + messageUids[i] + "']" ).toggleClass( "unread bold" );
-        messages.find( "input:checkbox" ).removeAttr( "checked" );
     }
 }
 
+function toggleRowSelected( element )
+{
+    $( element ).closest( "tr" ).toggleClass( "list-row-selected", element.checked );
+}
+
 function read( id )
 {
     window.location.href = "readMessage.action?id=" + id;

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm	2014-09-22 15:08:21 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm	2014-10-03 11:32:55 +0000
@@ -41,12 +41,12 @@
                 #foreach( $conversation in $conversations )
                 <tr name="${conversation.uid}" id="tr${conversation.id}" #if( !$conversation.read )class="unread bold"#end>
                     <td style="width:20px;padding-left:5px;">
-                        <input type="checkbox" value="${conversation.uid}" />
+                        <input type="checkbox" value="${conversation.uid}" onchange="toggleRowSelected( this )"/>
                     </td>
                     <td style="width:40px;padding-left:5px;" onclick="toggleFollowUp( '${conversation.id}' )">
                         <img id="followUp${conversation.id}" #if( $conversation.followUp ) src="../images/marked.png"#else src="../images/unmarked.png"#end></td>
                     <td style="width:200px" onclick="read( '${conversation.uid}' )">
-                        #if( $conversation.lastSenderName )$!encoder.htmlEncode( $conversation.lastSenderName )#else$i18n.getString( "system_notification" )#end
+                        #if( $conversation.lastSenderName )$!encoder.htmlEncode( $conversation.lastSenderName )#else $i18n.getString( "system_notification" )#end
                         #if( $conversation.messageCount > 1 ) <span class="normal">(${conversation.messageCount})</span>#end
                     </td>
                     <td onclick="read( '${conversation.uid}' )">$!encoder.htmlEncode( $conversation.subject )</td>

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css	2014-08-26 16:08:08 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css	2014-10-03 11:32:55 +0000
@@ -366,6 +366,11 @@
   background-color: #ebf0f6;
 }
 
+.list-row-selected td
+{
+  background-color: #fff4cb;
+}
+
 .recipientsDiv
 { 
   width: 660px;