Fix text selection
This commit is contained in:
parent
9947b537b6
commit
8b392a9fa0
@ -386,7 +386,20 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
chat.on("click", ".messages", focus);
|
||||
chat.on("click", ".messages", function() {
|
||||
setTimeout(function() {
|
||||
var text = "";
|
||||
if (window.getSelection) {
|
||||
text = window.getSelection().toString();
|
||||
} else if (document.selection && document.selection.type != "Control") {
|
||||
text = document.selection.createRange().text;
|
||||
}
|
||||
if (!text) {
|
||||
focus();
|
||||
}
|
||||
}, 2);
|
||||
});
|
||||
|
||||
$(window).on("focus", focus);
|
||||
|
||||
function focus() {
|
||||
@ -641,13 +654,13 @@ $(function() {
|
||||
var direction = keys.split("+").pop();
|
||||
switch (direction) {
|
||||
case "up":
|
||||
// Wrap around!
|
||||
// Loop
|
||||
var upTarget = (channels.length + (index - 1 + channels.length)) % channels.length;
|
||||
channels.eq(upTarget).click();
|
||||
break;
|
||||
|
||||
case "down":
|
||||
// Wrap aroud!
|
||||
// Loop
|
||||
var downTarget = (channels.length + (index + 1 + channels.length)) % channels.length;
|
||||
channels.eq(downTarget).click();
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "shout",
|
||||
"description": "The self-hosted web IRC client",
|
||||
"version": "0.38.7",
|
||||
"version": "0.38.8",
|
||||
"author": "Mattias Erming",
|
||||
"preferGlobal": true,
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user