Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C78A6999C for ; Sat, 28 Jul 2012 03:41:25 +0000 (UTC) Received: (qmail 61231 invoked by uid 500); 28 Jul 2012 03:41:25 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 60650 invoked by uid 500); 28 Jul 2012 03:41:24 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 59845 invoked by uid 99); 28 Jul 2012 03:41:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jul 2012 03:41:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3098D19B24; Sat, 28 Jul 2012 03:41:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chipchilders@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [10/13] git commit: CS-15325: Fix selected name of user from the drop down list overlay. Message-Id: <20120728034122.3098D19B24@tyr.zones.apache.org> Date: Sat, 28 Jul 2012 03:41:21 +0000 (UTC) CS-15325: Fix selected name of user from the drop down list overlay. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/0be4230f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/0be4230f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/0be4230f Branch: refs/heads/master Commit: 0be4230f91115a65d8fe8644b1fe50709a2114d9 Parents: 9d67ecd Author: olgasmola Authored: Fri Jul 27 16:27:59 2012 +0300 Committer: chip.childers@gmail.com Committed: Fri Jul 27 23:37:45 2012 -0400 ---------------------------------------------------------------------- ui/css/cloudstack3.css | 2 ++ ui/scripts/ui-custom/login.js | 19 +++++++++++++------ ui/scripts/ui/core.js | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0be4230f/ui/css/cloudstack3.css ---------------------------------------------------------------------- diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index a60e480..876d663 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -280,6 +280,8 @@ body.login { .login .fields .field label.error { color: #FF0000; float: right; + left: 204px; + top: 0; } .login .fields input { http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0be4230f/ui/scripts/ui-custom/login.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/login.js b/ui/scripts/ui-custom/login.js index 20e6abf..c092b82 100644 --- a/ui/scripts/ui-custom/login.js +++ b/ui/scripts/ui-custom/login.js @@ -53,7 +53,7 @@ $form.validate(); // Form label behavior - $inputs.bind('keydown keyup focus blur', function(event) { + $inputs.bind('keydown focus click blur', function(event) { var $target = $(event.target); var $label = $form.find('label').filter(function() { return $(this).attr('for') == $target.attr('name'); @@ -63,11 +63,16 @@ $label.hide(); return true; - } else { - if (!$target.val()) { + } else if (event.type == 'blur') { + if ($target.hasClass('first-input')) { + $target.removeClass('first-input'); + } + if (!$(this).val()) { $label.show(); - } else { - $label.hide(); + } + } else { + if (!$target.hasClass('first-input')) { + $label.hide(); } } @@ -79,11 +84,13 @@ // Labels cause related input to be focused $login.find('label').click(function() { var $input = $inputs.filter('[name=' + $(this).attr('for') + ']'); + var $label = $(this); $input.focus(); + $label.hide(); }); - $inputs.filter(':first').focus(); + $inputs.filter(':first').addClass('first-input').focus(); // Login action $login.find('input[type=submit]').click(function() { http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0be4230f/ui/scripts/ui/core.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index b7ffdba..0c6b4e7 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -352,7 +352,7 @@ // Check if target should be hovered function checkHoveredLabel($target) { var $multiWizard = $('div.ui-dialog div.multi-wizard'); - if ($target.is('label[for]') || + if (($target.is('label[for]') && !$target.parents('body.login')) || ($multiWizard.size() && ($target.is('.multi-wizard label') && $target.prev('input[type="radio"],input[type="checkbox"]').size()) || ($target.is('.multi-wizard .select-desc div.name') && $target.parent('div.select-desc').prev('input[type="radio"],input[type="checkbox"]').size())