parent
2a7dadd6ee
commit
45a2d074fb
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const $ = require("jquery");
|
const $ = require("jquery");
|
||||||
|
|
||||||
const options = require("./options");
|
const options = require("./options");
|
||||||
const templates = require("../views");
|
const templates = require("../views");
|
||||||
|
const input = $("#input");
|
||||||
|
|
||||||
module.exports = renderPreview;
|
module.exports = renderPreview;
|
||||||
|
|
||||||
@ -81,15 +81,14 @@ function handleImageInPreview(content, container) {
|
|||||||
|
|
||||||
const imageViewer = $("#image-viewer");
|
const imageViewer = $("#image-viewer");
|
||||||
|
|
||||||
// FIXME Remove #input focus when this is open
|
$("#chat").on("click", ".toggle-thumbnail", function() {
|
||||||
// See https://github.com/thelounge/lounge/issues/1342
|
|
||||||
$("#viewport").on("click", ".toggle-thumbnail", function() {
|
|
||||||
const link = $(this);
|
const link = $(this);
|
||||||
|
|
||||||
openImageViewer(link);
|
openImageViewer(link);
|
||||||
|
|
||||||
// Prevent the link to open a new page since we're opening the image viewer,
|
// Prevent the link to open a new page since we're opening the image viewer,
|
||||||
// but keep it a link to allow for Ctrl/Cmd+click
|
// but keep it a link to allow for Ctrl/Cmd+click.
|
||||||
|
// By binding this event on #chat we prevent input gaining focus after clicking.
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -170,4 +169,6 @@ function closeImageViewer() {
|
|||||||
.one("transitionend", function() {
|
.one("transitionend", function() {
|
||||||
imageViewer.empty();
|
imageViewer.empty();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
input.focus();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user