You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2012/07/28 05:41:21 UTC

[9/13] git commit: CS-15518: Fix password field garbling on login screen.

CS-15518: Fix password field garbling on login screen.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/9d67ecdb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/9d67ecdb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/9d67ecdb

Branch: refs/heads/master
Commit: 9d67ecdbb75603dae3469c80871f4fae584ccafb
Parents: 3f4e906
Author: olgasmola <ol...@gmail.com>
Authored: Fri Jul 27 15:36:58 2012 +0300
Committer: chip.childers@gmail.com <ch...@gmail.com>
Committed: Fri Jul 27 23:37:45 2012 -0400

----------------------------------------------------------------------
 ui/scripts/ui-custom/login.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9d67ecdb/ui/scripts/ui-custom/login.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/login.js b/ui/scripts/ui-custom/login.js
index 72b3c6c..20e6abf 100644
--- a/ui/scripts/ui-custom/login.js
+++ b/ui/scripts/ui-custom/login.js
@@ -38,6 +38,17 @@
     $login.appendTo('html body');
     $('html body').addClass('login');
 
+    // Remove label if field was auto filled
+    $.each($form.find('label'), function() {
+      var $label = $(this);
+      var $input = $form.find('input').filter(function() {
+        return $(this).attr('name') == $label.attr('for');
+      });
+      if ($input.val()) {
+        $label.hide();
+      }
+    });
+
     // Form validation
     $form.validate();