Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Fix blocking of text input due to control-f search
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Mar 10, 2018
1 parent e10129f commit 80d8b45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions apps/feed/templates/feed/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ <h5 class="modal-title text-center" id="postaddtitleheader">
computed: {
remainingChars: function(){
var length = 140 - this.post_text.length;
console.log(length);
return length;
}
}
Expand Down Expand Up @@ -456,7 +455,6 @@ <h5 class="media-heading date_created_value" value="__prefix_post_created_on__">
html = html.replace("__prefix_post_id__", response_data.data[i-1].id);
var a = moment(response_data.data[i-1].created).fromNow();
response_data.m = a;
console.log(response_data.m);
html = html.replace(/__prefixpostcreatedonnatural__/g, response_data.m);
html = html.replace(/__prefix_post_created_on__/g,response_data.data[i-1].created);
html = html.replace(/__hidden__/g, '');
Expand Down
1 change: 0 additions & 1 deletion apps/posts/templates/posts/post_add.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ <h5 class="modal-title text-center" id="postaddtitleheader">
computed: {
remainingChars: function(){
var length = 140 - this.post_text.length;
console.log(length);
return length;
}
}
Expand Down
9 changes: 4 additions & 5 deletions chirp/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,12 @@
$(window).scrollTop(0);
$('#postAddModal').modal('show');
});
$(window).keypress(function(event) {
if (!(event.which == 102 && event.ctrlKey) && !(event.which == 19)){
$(document).on('keydown', function(e){
if(e.ctrlKey && e.which === 70){ // Check for the Ctrl key being pressed, and if the key = [S] (83)
e.preventDefault();
$('#auto-search').focus();
return true;
return false;
}
event.preventDefault();
return false;
});
</script>
</html>

0 comments on commit 80d8b45

Please sign in to comment.