From 40be3a6e4f2c83b93ea90773da2dcce746a3fbd5 Mon Sep 17 00:00:00 2001 From: Mike Stenhouse Date: Fri, 23 Sep 2011 17:09:45 +0100 Subject: [PATCH] =?UTF-8?q?Adding=20readonly=20to=20the=20disabled=20style?= =?UTF-8?q?s=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use case: I have a form. When the user clicks on a (fancy) submit it gets a disabled attribute. Now the button's value doesn't get submitted and the server has no way of knowing which button the user clicked. More useful is setting the button to readonly - avoids multiple form submissions but still sends its value. --- lib/stylesheets/_fancy-buttons.sass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/stylesheets/_fancy-buttons.sass b/lib/stylesheets/_fancy-buttons.sass index a673bd6..64e8160 100755 --- a/lib/stylesheets/_fancy-buttons.sass +++ b/lib/stylesheets/_fancy-buttons.sass @@ -44,7 +44,7 @@ $fb-line-height: 1.2em !default +box-shadow(rgba(#fff, (lightness($color))/100) 0 0 .1em 1px inset) +background-clip(padding-box) @if $fb-allow-disabled - &.disabled, &[disabled] + &.disabled, &[disabled], &.readonly, &[readonly] +disable-fancy-button($color) =fancy-button-allow-disable($color: $fb-color, $font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width) @@ -128,7 +128,7 @@ $fb-line-height: 1.2em !default &:active color: $active @if $fb-allow-disabled - &.disabled, &[disabled] + &.disabled, &[disabled], &.readonly, &[readonly] color: $color // Layout the button's box