Only show request for comments button after a delay

This commit is contained in:
Maximilian Grundke
2016-04-30 14:25:47 +02:00
parent ee164b9e68
commit 651609b673
2 changed files with 9 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ $(function() {
var THEME = 'ace/theme/textmate'; var THEME = 'ace/theme/textmate';
var REMEMBER_TAB = false; var REMEMBER_TAB = false;
var AUTOSAVE_INTERVAL = 15 * 1000; var AUTOSAVE_INTERVAL = 15 * 1000;
var REQUEST_FOR_COMMENTS_DELAY = 5 * 60 * 1000;
var NONE = 0; var NONE = 0;
var WEBSOCKET = 1; var WEBSOCKET = 1;
var SERVER_SEND_EVENT = 2; var SERVER_SEND_EVENT = 2;
@@ -477,11 +478,17 @@ $(function() {
}; };
var initializeRequestForComments = function () { var initializeRequestForComments = function () {
$('#requestCommentsButton').on('click', function() { var button = $('#requestCommentsButton');
button.hide();
button.on('click', function() {
$('#comment-modal').modal('show'); $('#comment-modal').modal('show');
}); });
$('#askForCommentsButton').on('click', requestComments); $('#askForCommentsButton').on('click', requestComments);
setTimeout(function() {
button.fadeIn();
}, REQUEST_FOR_COMMENTS_DELAY);
}; };
var isActiveFileBinary = function() { var isActiveFileBinary = function() {

View File

@@ -14,6 +14,6 @@
.editor-content.hidden data-file-id=file.ancestor_id = file.content .editor-content.hidden data-file-id=file.ancestor_id = file.content
.editor data-file-id=file.ancestor_id data-indent-size=file.file_type.indent_size data-mode=file.file_type.editor_mode data-read-only=file.read_only data-id=file.id .editor data-file-id=file.ancestor_id data-indent-size=file.file_type.indent_size data-mode=file.file_type.editor_mode data-read-only=file.read_only data-id=file.id
button.btn class='btn-primary' id='requestCommentsButton' type='button' button.btn.btn-primary id='requestCommentsButton' type='button'
i.fa.fa-comment-o i.fa.fa-comment-o
= t('exercises.editor.requestComments') = t('exercises.editor.requestComments')