← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16195: tracker capture - minor for adjusting dropdown width during searching and program selection

 

------------------------------------------------------------
revno: 16195
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Mon 2014-07-21 11:39:19 +0200
message:
  tracker capture - minor for adjusting dropdown width during searching and program selection
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html


--
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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js	2014-07-17 10:35:43 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js	2014-07-21 09:39:19 +0000
@@ -126,17 +126,24 @@
         }
     });
 
-    //dhis2.availability.startAvailabilityCheck();
+    //dhis2.availability.startAvailabilityCheck();    
     
-    var selectParentWidth = $("#selectDropDownParent").width();
-    $("#selectDropDown").width(selectParentWidth);
-    $(".select-drop-down-button").on('click', function(e) {
+    $(".select-dropdown-button").on('click', function(e) {
+        $("#selectDropDown").width($("#selectDropDownParent").width());
         e.stopPropagation();
         $("#selectDropDown").dropdown('toggle');
     });  
     
-    var searchParentWidth = $("#searchDropDownParent").width();    
-    $("#searchDropDown").width(searchParentWidth);
+    $(".select-dropdown-caret").on('click', function(e) {
+        $("#selectDropDown").width($("#selectDropDownParent").width());
+        e.stopPropagation();
+        $("#selectDropDown").dropdown('toggle');
+    }); 
+    
+    $(".search-dropdown-button").on('click', function() {
+        $("#searchDropDown").width($("#searchDropDownParent").width());
+    }); 
+    
     $('#searchDropDown').on('click', "[data-stop-propagation]", function(e) {
         e.stopPropagation();
     });   
@@ -144,10 +151,8 @@
 });
 
 $(window).resize(function() {
-    var searchWidth = $("#searchDropDownParent").width();
-    var selectWidth = $("#selectDropDownParent").width();
-    $("#selectDropDown").width(selectWidth);
-    $("#searchDropDown").width(searchWidth);
+    $("#selectDropDown").width($("#selectDropDownParent").width());
+    $("#searchDropDown").width($("#searchDropDownParent").width());
 });
 
 function ajax_login()

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-07-17 10:35:43 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-07-21 09:39:19 +0000
@@ -700,12 +700,16 @@
     text-decoration: underline;
 }
 
-.select-drop-down-button{
+.select-dropdown-button{
     text-align: left;
     padding: 2px 4px;
     color: #999;
 }
 
+.select-dropdown-caret {
+    margin-bottom: 5px; 
+    margin-top: 5px;    
+}
 .dropdown-menu {
     margin: -5px 0 0 0;
 }
@@ -744,7 +748,7 @@
     width: 30%;
 }
 
-.without-border-radius{
+.search-dropdown-button {
     border-radius: 0;
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-07-15 13:13:11 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-07-21 09:39:19 +0000
@@ -42,11 +42,11 @@
 
     <!--- search, registration and reporting menu begins -->
     <div class="row"> 
-        <div id="selectDropDownParent" class="input-group col-md-3">            
-            <button type="button" class="select-drop-down-button form-control" ng-show="programs.length > 0">{{selectedProgram ? selectedProgram.name : 'please_select_a_program'| translate}}</button>
-            <button type="button" class="select-drop-down-button form-control" ng-show="programs.length < 1" ng-disabled="true">{{programs.length > 0 ? 'please_select_a_program' : 'no_program_exists' | translate}}</button>
+        <div id="selectDropDownParent" class="input-group col-md-4">            
+            <button type="button" class="select-dropdown-button form-control" ng-show="programs.length > 0">{{selectedProgram ? selectedProgram.name : 'please_select_a_program'| translate}}</button>
+            <button type="button" class="select-dropdown-button form-control" ng-show="programs.length < 1" ng-disabled="true">{{programs.length > 0 ? 'please_select_a_program' : 'no_program_exists' | translate}}</button>
             <div class="input-group-btn">
-                <button class="btn btn-default trim" type="button" title="{{'list_programs'| translate}}" data-toggle="dropdown" ng-disabled="programs.length < 1"><i class="fa fa-caret-down"></i></button>
+                <button class="btn btn-default select-dropdown-caret" type="button" title="{{'list_programs'| translate}}" data-toggle="dropdown" ng-disabled="programs.length < 1"><i class="fa fa-caret-down"></i></button>
                 <ul id="selectDropDown" class="dropdown-menu dropdown-menu-right">
                     <li>
                         <a href ng-click="getProgramAttributes(null)">{{'please_select_a_program' | translate}}</a>
@@ -57,10 +57,10 @@
                 </ul>
             </div>                
         </div>
-        <div id="searchDropDownParent" class="input-group col-md-5">
+        <div id="searchDropDownParent" class="input-group col-md-4">
             <input type="text" placeholder="{{'type_here_for_simple_search'| translate}}" ng-model="searchText" class="form-control expanded" ng-class="{true: 'invalid-input'} [!searchText && emptySearchText]" ng-focus="showHideSearch()" ng-disabled="showRegistrationDiv || showReportDiv">
             <div class="input-group-btn">
-                <button class="btn btn-default without-border-radius trim" type="button" title="{{'advanced_search'| translate}}" data-toggle="dropdown" ng-click="showHideSearch()" ng-disabled="showRegistrationDiv || showReportDiv"><i class="fa fa-caret-down"></i></button>
+                <button class="btn btn-default search-dropdown-button trim" type="button" title="{{'advanced_search'| translate}}" data-toggle="dropdown" ng-click="showHideSearch()" ng-disabled="showRegistrationDiv || showReportDiv"><i class="fa fa-caret-down"></i></button>
                 <button class="btn btn-primary trim" type="button" title="{{'search'| translate}}" ng-disabled="showRegistrationDiv || showReportDiv" ng-click="search(searchMode.freeText)"><i class="fa fa-search"></i></button>
                 <div id="searchDropDown" class="dropdown-menu dropdown-menu-right">
                     <form ng-include="'views/search.html'">