From 7803df5ecdd70845f4bd46db48a8a7318d16d1d3 Mon Sep 17 00:00:00 2001 From: Aruna Herath Date: Mon, 27 May 2013 17:01:33 +0530 Subject: [PATCH] Changed post/comment submit keyboard shortcut to ctrl+enter from shift+enter Fixes reopened #3897 --- Changelog.md | 1 + app/assets/javascripts/app/views/comment_stream_view.js | 2 +- app/assets/javascripts/app/views/publisher_view.js | 2 +- spec/javascripts/app/views/comment_stream_view_spec.js | 4 ++-- spec/javascripts/app/views/publisher_view_spec.js | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index baa6415c5..b8b73bbed 100644 --- a/Changelog.md +++ b/Changelog.md @@ -167,6 +167,7 @@ everything is set up. * Fix missing indent to correct logged-out-header container relative positioning [#4134](https://github.com/diaspora/diaspora/pull/4134) * Private post dont show error 404 when you are not authorized on mobile page [#4129](https://github.com/diaspora/diaspora/issues/4129) * Show 404 instead of 500 if a not signed in user wants to see a non public or non existing post. +* 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();