Fix some obvious things now that the RPC is slightly better.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3957 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-08-13 19:39:29 +00:00
parent d70dba021a
commit fc9c3982c2
10 changed files with 43 additions and 28 deletions

View File

@@ -67,7 +67,7 @@ Vue.component('tf-message', {
show_message: function() {
window.parent.postMessage({
action: 'setHash',
hash: tf.g_data.whoami + ':' + this.message.id,
hash: this.message.id,
}, '*');
},
expand_image: function(event) {
@@ -89,7 +89,12 @@ Vue.component('tf-message', {
img.style.objectFit = 'contain';
img.style.width = '100%';
div.appendChild(img);
div.onclick = function() { document.body.removeChild(div); };
function image_close(event) {
document.body.removeChild(div);
window.removeEventListener('keydown', image_close);
}
div.onclick = image_close;
window.addEventListener('keydown', image_close);
document.body.appendChild(div);
},
},