aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-06 00:35:25 -0800
committerfriendica <info@friendica.com>2011-12-06 00:35:25 -0800
commitf3c91edd9577a04c9c9d31140346037f885d8a71 (patch)
tree7771825fb683ad7a83a725bc1dc4b970044885ed
parentbe8e9d36160d8a45bb11c3ab9ecdbf0c4f5cdf7d (diff)
parentcd3a02ab8e5aa2dc56ba3939e5d480e4966b11aa (diff)
downloadvolse-hubzilla-f3c91edd9577a04c9c9d31140346037f885d8a71.tar.gz
volse-hubzilla-f3c91edd9577a04c9c9d31140346037f885d8a71.tar.bz2
volse-hubzilla-f3c91edd9577a04c9c9d31140346037f885d8a71.zip
Merge pull request #15 from zzottel/master
Added pausing of automatic stream reloads using Ctrl-Space
-rw-r--r--js/main.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/js/main.js b/js/main.js
index f41071ca1..2b486beda 100644
--- a/js/main.js
+++ b/js/main.js
@@ -16,12 +16,12 @@
document.getElementById(theID).style.display = "none"
}
-
var src = null;
var prev = null;
var livetime = null;
var msie = false;
var stopped = false;
+ var totStopped = false;
var timer = null;
var pr = 0;
var liking = 0;
@@ -148,26 +148,26 @@
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
- $(document).keypress(function(event) {
- if(event.keyCode == '19') {
+ $(document).keydown(function(event) {
+ if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
event.preventDefault();
if(stopped == false) {
stopped = true;
+ if (event.ctrlKey) {
+ totStopped = true;
+ }
$('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
- }
- else {
+ } else {
stopped = false;
+ totStopped = false;
$('#pause').html('');
}
- }
- else {
- // any key to resume
- if(stopped == true) {
+ } else {
+ if (!totStopped) {
stopped = false;
$('#pause').html('');
}
}
-
});