diff --git a/client/js/controls/post_content_control.js b/client/js/controls/post_content_control.js index 7a0012a..e7f35e7 100644 --- a/client/js/controls/post_content_control.js +++ b/client/js/controls/post_content_control.js @@ -5,10 +5,10 @@ const views = require('../util/views.js'); const optimizedResize = require('../util/optimized_resize.js'); class PostContentControl { - constructor(containerNode, post, viewportSizeCalculator) { + constructor(hostNode, post, viewportSizeCalculator) { this._post = post; this._viewportSizeCalculator = viewportSizeCalculator; - this._containerNode = containerNode; + this._hostNode = hostNode; this._template = views.getTemplate('post-content'); this._currentFitFunction = { @@ -24,6 +24,10 @@ class PostContentControl { 'changeContent', e => this._evtPostContentChange(e)); } + disableOverlay() { + this._hostNode.querySelector('.post-overlay').style.display = 'none'; + } + fitWidth() { this._currentFitFunction = this.fitWidth; const mul = this._post.canvasHeight / this._post.canvasWidth; @@ -94,7 +98,7 @@ class PostContentControl { this._reinstall(); optimizedResize.add(() => this._refreshSize()); views.monitorNodeRemoval( - this._containerNode, () => { this._uninstall(); }); + this._hostNode, () => { this._uninstall(); }); } _reinstall() { @@ -103,9 +107,9 @@ class PostContentControl { newNode.classList.add('transparency-grid'); } if (this._postContentNode) { - this._containerNode.replaceChild(newNode, this._postContentNode); + this._hostNode.replaceChild(newNode, this._postContentNode); } else { - this._containerNode.appendChild(newNode); + this._hostNode.appendChild(newNode); } this._postContentNode = newNode; this._refreshSize(); diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index 0b884c9..c24bdf5 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -27,7 +27,8 @@ class PostEditSidebarControl extends events.EventTarget { canEditPostSource: api.hasPrivilege('posts:edit:source'), canEditPostTags: api.hasPrivilege('posts:edit:tags'), canEditPostRelations: api.hasPrivilege('posts:edit:relations'), - canEditPostNotes: api.hasPrivilege('posts:edit:notes'), + canEditPostNotes: api.hasPrivilege('posts:edit:notes') && + post.type !== 'video', canEditPostFlags: api.hasPrivilege('posts:edit:flags'), canEditPostContent: api.hasPrivilege('posts:edit:content'), canEditPostThumbnail: api.hasPrivilege('posts:edit:thumbnail'), diff --git a/client/js/views/post_view.js b/client/js/views/post_view.js index 1e7fc2f..0b26061 100644 --- a/client/js/views/post_view.js +++ b/client/js/views/post_view.js @@ -51,6 +51,10 @@ class PostView { postContainerNode.querySelector('.post-overlay'), ctx.post); + if (ctx.post.type === 'video') { + this._postContentControl.disableOverlay(); + } + this._installSidebar(ctx); this._installCommentForm(); this._installComments(ctx.post.comments);