From 7a6d1d337863132a749ddb59b0efde0f8477e142 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 10 Feb 2011 11:09:14 -0800 Subject: [PATCH] add shadow/transparency to autocompletion. removed a hide()/show() from publisher hide and show functions. --- public/javascripts/publisher.js | 2 -- public/stylesheets/sass/autocomplete.sass | 14 ++++++++++++-- spec/javascripts/publisher-spec.js | 10 ---------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index ac5bd9c6d..42fec7092 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -7,12 +7,10 @@ var Publisher = { close: function(){ Publisher.form().addClass('closed'); - Publisher.form().find(".options_and_submit").hide(); Publisher.form().find("textarea").css('min-height', ''); }, open: function(){ Publisher.form().removeClass('closed'); - Publisher.form().find(".options_and_submit").show(); Publisher.form().find("textarea").css('min-height', '42px'); }, cachedForm : false, diff --git a/public/stylesheets/sass/autocomplete.sass b/public/stylesheets/sass/autocomplete.sass index fa13b3603..c6aa09aff 100644 --- a/public/stylesheets/sass/autocomplete.sass +++ b/public/stylesheets/sass/autocomplete.sass @@ -1,14 +1,19 @@ .ac_results :border 1px solid #999 - :background-color white + :background-color transparent :overflow hidden :z-index 99999 - :width 247px !important + :min-width 247px !important + :width 100% :-webkit-border-radius 3px :-moz-border-radius 3px :border-radius 3px + :-webkit-box-shadow 0 1px 3px #999 + :-moz-box-shadow 0 1px 3px #999 + :box-shadow 0 1px 3px #999 + .ac_results ul :width 100% :list-style-position outside @@ -40,6 +45,11 @@ .ac_odd :background-color #fafafa + :background-color rgba(250,250,250,0.95) + +.ac_even + :background-color #fff + :background-color rgba(255,255,255,0.95) .ac_over :background-color #3F8FBA diff --git a/spec/javascripts/publisher-spec.js b/spec/javascripts/publisher-spec.js index e3f5e9ea0..b67fa55c3 100644 --- a/spec/javascripts/publisher-spec.js +++ b/spec/javascripts/publisher-spec.js @@ -30,11 +30,6 @@ describe("Publisher", function() { Publisher.open(); expect(Publisher.form().hasClass('closed')).toBeFalsy(); }); - it("shows the options_and_submit div", function() { - expect(Publisher.form().find(".options_and_submit:visible").length).toBe(0); - Publisher.open(); - expect(Publisher.form().find(".options_and_submit:visible").length).toBe(1); - }); }); describe("close", function() { beforeEach(function() { @@ -46,11 +41,6 @@ describe("Publisher", function() { Publisher.close(); expect(Publisher.form().hasClass('closed')).toBeTruthy(); }); - it("hides the options_and_submit div", function() { - expect(Publisher.form().find(".options_and_submit:visible").length).toBe(1); - Publisher.close(); - expect(Publisher.form().find(".options_and_submit:visible").length).toBe(0); - }); }); describe("input", function(){ beforeEach(function(){