← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8337: mobile: minor fixes

 

------------------------------------------------------------
revno: 8337
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-10-02 14:20:25 +0700
message:
  mobile: minor fixes
modified:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/new-message.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.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-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm	2012-10-01 04:01:22 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm	2012-10-02 07:20:25 +0000
@@ -18,11 +18,12 @@
     });
 
     jQuery(document).bind('pageinit', function() {
-       $('#reply-form input:submit').bind('click', function() {
+       $('#reply-form input:submit').bind('click', function(e) {
             var msg = jQuery('#reply-text').val();
 
            if(msg.length == 0) {
-               return false;
+               e.preventDefault();
+               return;
            }
 
            $.mobile.showPageLoadingMsg();
@@ -41,7 +42,7 @@
                console.log("failed to send message");
            });
 
-           return false;
+           e.preventDefault();
        });
     });
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/new-message.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/new-message.vm	2012-10-02 07:12:18 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/new-message.vm	2012-10-02 07:20:25 +0000
@@ -71,15 +71,18 @@
 
     function manageRecipientsPage()
     {
-        var clearSearch = $('form[role="search"]').find('a[data-icon="delete"]').data('events')['click'][0];
-        $('form[role="search"]').find('a[data-icon="delete"]').unbind('click');
-        $('form[role="search"]').find('a[data-icon="delete"]').bind('click', displaySelected );
-        $('form[role="search"]').find('a[data-icon="delete"]').bind('click', clearSearch );
-
-        var fn1 = $('form[role="search"] input:text').data('events')['keyup'][1];
-        $('form[role="search"] input:text').unbind('keyup');
-
-        $('form[role="search"] input:text').bind('keyup', function () {
+        var searchField = $('form[role="search"] input:text');
+        var clearSearchButton = $('form[role="search"]').find('a[data-icon="delete"]');
+
+        var clearSearchFn = clearSearchButton.data('events')['click'][0];
+        clearSearchButton.unbind('click');
+        clearSearchButton.bind('click', displaySelected );
+        clearSearchButton.bind('click', clearSearchFn );
+
+        var fn1 = searchField.data('events')['keyup'][1];
+        searchField.unbind('keyup');
+
+        searchField.bind('keyup', function () {
             var search = $('form[role="search"] input:text').val();
 
             if( search.length == 0)
@@ -141,7 +144,7 @@
         displaySelected();
     }
 
-    function sendMessage() {
+    function sendMessage(e) {
         var subject = jQuery('#new-message-subject').val();
         var text = jQuery('#new-message-text').val();
 
@@ -184,7 +187,7 @@
             console.log("failed to send message");
         });
 
-        return false;
+        e.preventDefault();
     }
 
     function newMessagePage()

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.vm	2012-10-01 04:01:22 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.vm	2012-10-02 07:20:25 +0000
@@ -12,7 +12,7 @@
             $('#jobTitleInput').val(data.jobTitle);
         });
 
-        $('input:submit').bind('click', function() {
+        $('input:submit').bind('click', function(e) {
             var settings = $('#settings-form').serializeArray();
 
             settings = _(settings).reduce(function(acc, field) {
@@ -32,7 +32,7 @@
                 window.location.href = '../dhis-web-mobile';
             });
 
-            return false;
+            e.preventDefault();
         })
     });
 </script>