Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update button state classes to follow naming convention. #416

Merged
merged 1 commit into from
Jan 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions js/validation.js
Original file line number Diff line number Diff line change
@@ -228,13 +228,7 @@ define(function(require) {

// Disable that guy
$submitButton.attr("disabled", true);
$submitButton.addClass("loading");

// If <button>, add a loading style
if($submitButton.prop("tagName") === "BUTTON") {
// Neue's `.loading` class only works on <a> or <button> :(
$submitButton.addClass("loading");
}
$submitButton.addClass("is-loading");
};


12 changes: 6 additions & 6 deletions scss/_components/_button.scss
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@
// :hover - Suble hover state (will not be displayed on touch interfaces)
// :focus - Focus state for users navigating the page using tab keys.
// :active - "Pushed" button state
// .disabled - Disabled (non-interactive) button state. Consider removing button from interface if not necessary to avoid confusion.
// .-loading - AJAX loading animation. Used when loading results inline.
// .-secondary - Should be used if not the main call-to-action on a page.
// .-tertiary - Used to de-emphasize button (for example, a "cancel" option), but still show inline with other fields.
// .is-disabled - Disabled (non-interactive) button state. Consider removing button from interface if not necessary to avoid confusion.
// .is-loading - AJAX loading animation. Used when loading results inline.
// .-secondary - Should be used if not the main call-to-action on a page.
// .-tertiary - Used to de-emphasize button (for example, a "cancel" option), but still show inline with other fields.
//
// Styleguide Forms - Buttons
.button {
@@ -91,7 +91,7 @@
}

// disabled state
&[disabled], &.disabled {
&[disabled], &.is-disabled {
background: $light-gray;
color: lighten($light-gray, 10%);
cursor: default;
@@ -106,7 +106,7 @@
}
}

&.-loading {
&.is-loading {
position: relative;
color: transparent;
background: #eee neue-asset-url("images/spinner.svg") no-repeat center center;