diff --git a/Changelog.md b/Changelog.md index 3e905252f..980b72a0e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ * Fix tags ordering in chrome [#4133](https://github.com/diaspora/diaspora/issues/4133) * Fix src URL for oEmbed iFrame [#4178](https://github.com/diaspora/diaspora/pull/4178) * Add back-to-top button on tag and user pages [#4185](https://github.com/diaspora/diaspora/issues/4185) +* Fix reopened issue by changing the comment/post submit keyboard sortcut to ctrl+enter from shift+enter [#3897](https://github.com/diaspora/diaspora/issues/3897) ## Features diff --git a/app/assets/javascripts/app/views/comment_stream_view.js b/app/assets/javascripts/app/views/comment_stream_view.js index 7f242ddb8..82a981d4b 100644 --- a/app/assets/javascripts/app/views/comment_stream_view.js +++ b/app/assets/javascripts/app/views/comment_stream_view.js @@ -53,7 +53,7 @@ app.views.CommentStream = app.views.Base.extend({ }, keyDownOnCommentBox: function(evt) { - if(evt.keyCode == 13 && evt.shiftKey) { + if(evt.keyCode == 13 && evt.ctrlKey) { this.$("form").submit() return false; } diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 639b66c85..efe7f3851 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -210,7 +210,7 @@ app.views.Publisher = Backbone.View.extend(_.extend( }, keyDown : function(evt) { - if( evt.keyCode == 13 && evt.shiftKey ) { + if( evt.keyCode == 13 && evt.ctrlKey ) { this.$("form").submit(); this.open(); return false; diff --git a/spec/javascripts/app/views/comment_stream_view_spec.js b/spec/javascripts/app/views/comment_stream_view_spec.js index 994acf2d9..b474c5c5c 100644 --- a/spec/javascripts/app/views/comment_stream_view_spec.js +++ b/spec/javascripts/app/views/comment_stream_view_spec.js @@ -94,14 +94,14 @@ describe("app.views.CommentStream", function(){ expect(submitCallback).not.toHaveBeenCalled(); }) - it("should submit the form when enter is pressed with shift", function(){ + it("should submit the form when enter is pressed with ctrl", function(){ this.view.render(); var form = this.view.$("form") var submitCallback = jasmine.createSpy().andReturn(false); form.submit(submitCallback); var e = $.Event("keydown", { keyCode: 13 }); - e.shiftKey = true; + e.ctrlKey = true; this.view.keyDownOnCommentBox(e); expect(submitCallback).toHaveBeenCalled(); diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index 8f6ddb0c5..ed46a8a87 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -116,14 +116,14 @@ describe("app.views.Publisher", function() { }); describe("publishing a post with keyboard", function(){ - it("should submit the form when shift+enter is pressed", function(){ + it("should submit the form when ctrl+enter is pressed", function(){ this.view.render(); var form = this.view.$("form") var submitCallback = jasmine.createSpy().andReturn(false); form.submit(submitCallback); var e = $.Event("keydown", { keyCode: 13 }); - e.shiftKey = true; + e.ctrlKey = true; this.view.keyDown(e); expect(submitCallback).toHaveBeenCalled();