Fix CSS and blur on commant submission

This commit is contained in:
Augier 2017-02-02 11:25:43 +01:00 committed by cmrd Senya
parent fd39a48bea
commit 7b711254a5
No known key found for this signature in database
GPG key ID: 5FCC5BA680E67BFE
5 changed files with 14 additions and 7 deletions

View file

@ -152,6 +152,7 @@ app.views.CommentStream = app.views.Base.extend({
closeForm: function() {
this.$("form").removeClass("open");
this.$(".md-editor").removeClass("active");
this.commentBox.blur();
autosize.update(this.commentBox);
},

View file

@ -11,13 +11,15 @@ body {
#publisher_textarea_wrapper { background-color: $gray; }
.btn.btn-link.question_mark:hover .entypo-cog { color: $gray-light; }
}
.write-preview-tabs > li.active * { color: $text-color; }
.md-preview { background-color: $gray; }
.md-cancel:hover .entypo-cross { color: $gray-light; }
.publisher-buttonbar .btn.btn-link:hover i { color: $gray-light; }
}
.write-preview-tabs > li.active * { color: $text-color; }
.md-cancel:hover .entypo-cross { color: $gray-light; }
.md-input,
.md-preview { background-color: $gray; }
.aspect_dropdown li a .text { color: $dropdown-link-color; }
.info .tag { background-color: $gray-light; }
@ -95,6 +97,7 @@ body {
#welcome-to-diaspora { background: $orange; }
.md-editor,
.block-form fieldset .form-control:focus { border-color: $input-border; }
&.page-registrations.action-new,

View file

@ -92,7 +92,6 @@
.md-preview {
background: $white;
color: $text-color;
// !important is needed to override the CSS rules dynamically added to the element
// scss-lint:disable ImportantRule

View file

@ -21,10 +21,13 @@ describe("app.views.CommentStream", function(){
});
it("calls onFormBlur when clicking outside the comment box", function() {
spyOn(app.views.CommentStream.prototype, "onFormBlur");
// remove existing event handlers
$(document.body).off("click");
spyOn(this.view, "onFormBlur");
this.view.setupBindings();
$(document.body).click();
expect(app.views.CommentStream.prototype.onFormBlur).toHaveBeenCalled();
expect(this.view.onFormBlur).toHaveBeenCalled();
});
});

View file

@ -102,6 +102,7 @@ afterEach(function() {
expect($(".modal-backdrop").length).toBe(0);
$(".modal-backdrop").remove();
spec.loadFixtureCount = 0;
$(document.body).off();
});