← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15776: add search button to selected plugin

 

------------------------------------------------------------
revno: 15776
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-06-20 11:08:15 +0200
message:
  add search button to selected plugin
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm


--
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/dhis2/dhis2.selected.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.js	2014-05-26 08:49:52 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.js	2014-06-20 09:08:15 +0000
@@ -69,6 +69,11 @@
 
       if( context.search instanceof $ ) {
         context.search.on('keypress', context.makeSearchHandler(context));
+        var searchButton = $("#" + context.search.attr('id') + "Button");
+
+        searchButton.on('click', function() {
+          context.search.trigger({type: 'keypress', which: 13, keyCode: 13});
+        });
       }
     }
   };

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2014-04-07 07:19:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2014-06-20 09:08:15 +0000
@@ -438,8 +438,12 @@
     </thead>
     <tbody>
     <tr>
-      <td><input id="${args.prefix}AvailableSearch" type="text" placeholder=" Search.." style="width: 100%; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0;" /></td>
-      <td></td>
+      <td>
+        <input id="${args.prefix}AvailableSearch" type="text" placeholder=" Search.." style="width: 100%; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0;" />
+      </td>
+      <td>
+        <button id="${args.prefix}AvailableSearchButton" type="button"><i class="fa fa-search"></i></button>
+      </td>
       <td></td>
     </tr>
     <tr>