Refactor button colors
This commit is contained in:
parent
b7f4feacce
commit
f5bb4a4557
8 changed files with 9 additions and 42 deletions
|
|
@ -145,7 +145,7 @@ app.views.AspectMembership = app.views.AspectsDropdown.extend({
|
|||
// refresh the button text to reflect the current aspect selection status
|
||||
updateSummary: function(target) {
|
||||
this._toggleCheckbox(target);
|
||||
this._updateButton('green');
|
||||
this._updateButton("btn-success");
|
||||
}
|
||||
});
|
||||
// @license-end
|
||||
|
|
|
|||
|
|
@ -43,12 +43,12 @@ app.views.TagFollowingAction = app.views.Base.extend({
|
|||
},
|
||||
|
||||
mouseIn : function(){
|
||||
this.$("input").removeClass("green").addClass("btn-danger");
|
||||
this.$("input").removeClass("btn-success").addClass("btn-danger");
|
||||
this.$("input").val( Diaspora.I18n.t('stream.tags.stop_following', {tag: this.model.attributes.name} ) );
|
||||
},
|
||||
|
||||
mouseOut : function() {
|
||||
this.$("input").removeClass("btn-danger").addClass("green");
|
||||
this.$("input").removeClass("btn-danger").addClass("btn-success");
|
||||
this.$("input").val( Diaspora.I18n.t('stream.tags.following', {"tag" : this.model.attributes.name} ) );
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
@import 'sprites';
|
||||
@import 'hovercard';
|
||||
@import 'new_styles/base';
|
||||
@import 'new_styles/buttons';
|
||||
@import 'new_styles/interactions';
|
||||
@import 'new_styles/spinner';
|
||||
@import 'lightbox';
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
.btn.btn-primary {
|
||||
$button-border-color: #aaa;
|
||||
background: $dark-blue;
|
||||
color: #fff;
|
||||
border: 1px solid darken($button-border-color, 20%);
|
||||
text-shadow: none;
|
||||
&:hover, &:active {
|
||||
background: lighten($dark-blue, 10%);
|
||||
border: 1px solid darken($button-border-color,35%);
|
||||
}
|
||||
}
|
||||
.btn-group.open > .btn.btn-primary {
|
||||
background: $creation-blue;
|
||||
&:hover, &:active { background: lighten($dark-blue, 10%); }
|
||||
}
|
||||
|
||||
.btn.green {
|
||||
$button-border-color: #aaa;
|
||||
background: $green;
|
||||
color: $grey;
|
||||
border: 1px solid darken($button-border-color, 20% );
|
||||
|
||||
&:hover {
|
||||
background: $light-green;
|
||||
border: 1px solid darken($button-border-color,35%);
|
||||
}
|
||||
}
|
||||
.btn-group.open > .btn.green {
|
||||
background: $green;
|
||||
}
|
||||
|
||||
.btn.delete { color: desaturate($red,10%); }
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<div class="pull-right tag-following-action">
|
||||
<form accept-charset="UTF-8" action="/tag_followings" method="post">
|
||||
<input type="submit" class="btn
|
||||
<input type="submit" class="btn
|
||||
{{#if tag_is_followed }}
|
||||
green followed
|
||||
btn-success followed
|
||||
{{else}}
|
||||
btn-default
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ module AspectGlobalHelper
|
|||
aspect_membership_ids[a.id] = record.id
|
||||
end
|
||||
|
||||
button_class = selected_aspects.size>0 ? "green" : "btn-default"
|
||||
button_class = selected_aspects.size > 0 ? "btn-success" : "btn-default"
|
||||
button_class << case size
|
||||
when "small"
|
||||
" btn-small"
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ describe("app.views.AspectMembership", function(){
|
|||
spyOn(this.view, "_updateButton");
|
||||
this.view.updateSummary(this.Aspect);
|
||||
|
||||
expect(this.view._updateButton).toHaveBeenCalledWith('green');
|
||||
expect(this.view._updateButton).toHaveBeenCalledWith("btn-success");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ describe("app.views.TagFollowingAction", function(){
|
|||
|
||||
it("should have the extra classes if the tag is followed", function(){
|
||||
spyOn(this.view, "tag_is_followed").and.returnValue(true);
|
||||
expect(this.view.render().$('input').hasClass("followed")).toBe(true);
|
||||
expect(this.view.render().$('input').hasClass("green")).toBe(true);
|
||||
expect(this.view.render().$("input").hasClass("followed")).toBe(true);
|
||||
expect(this.view.render().$("input").hasClass("btn-success")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue