From 46c4c081d419b32be7ab74461be357a09cef6d9e Mon Sep 17 00:00:00 2001 From: Chris Van Date: Fri, 28 Sep 2012 14:27:26 -0700 Subject: [PATCH] fix craaaazy search placeholder bug (bug 794989) --- media/css/mkt/forms.less | 11 +++++++++++ media/css/mkt/search.less | 2 +- media/js/mkt/search.js | 9 --------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/media/css/mkt/forms.less b/media/css/mkt/forms.less index 99e7914f14..f7aa56b489 100644 --- a/media/css/mkt/forms.less +++ b/media/css/mkt/forms.less @@ -63,6 +63,17 @@ input:-moz-placeholder { color: @gray; } +input[placeholder] { + // Because bug 673873 is stupidface. + &:-moz-placeholder:focus { + color: transparent !important; + } + // Yes, the order matters. WebKit is clownshoes. + &:focus::-webkit-input-placeholder { + color: transparent !important; + } +} + input[type=text], input[type=password], input[type=email], select, textarea { .box-shadow(0 1px 0 fadeOut(@white, 40%), 0 1px 1px rgba(0,0,0,.1) inset, diff --git a/media/css/mkt/search.less b/media/css/mkt/search.less index 813d55f91d..1d63372070 100644 --- a/media/css/mkt/search.less +++ b/media/css/mkt/search.less @@ -39,7 +39,7 @@ 0 0 8px rgba(80, 160, 220, 0.6)); color: @white; } - &::-moz-placeholder { + &:-moz-placeholder { color: lighten(#99abb9, 3%); } &::-webkit-input-placeholder { diff --git a/media/js/mkt/search.js b/media/js/mkt/search.js index 6ac9acab7f..b0dd59d735 100644 --- a/media/js/mkt/search.js +++ b/media/js/mkt/search.js @@ -1,13 +1,4 @@ (function() { - // Because bug 673873 kills me. - $('input[placeholder]').on('focus', function() { - var $this = $(this); - $this.data('placeholder', $this.attr('placeholder')) - .removeAttr('placeholder'); - }).on('blur', function() { - var $this = $(this); - $this.attr('placeholder', $this.data('placeholder')); - }); // Add 'sel' class to active filter and set hidden input value. z.page.on('click', '#filters .toggles a', function() {