0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Removed feature image indicator and improved visibility of feature im… (#18877)

…age button

No ref
This commit is contained in:
Sanne de Vries 2023-11-06 14:56:24 +01:00 committed by GitHub
parent 7b9ecd6056
commit 7f6a252721
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 12 deletions

View file

@ -1,8 +1,6 @@
{{!-- template-lint-disable no-invalid-interactive --}} {{!-- template-lint-disable no-invalid-interactive --}}
<div <div
class="gh-editor-feature-image-container" class="gh-editor-feature-image-container"
{{on "mouseover" (fn (mut this.isHovered) true)}}
{{on "mouseleave" (fn (mut this.isHovered) false)}}
> >
{{!-- template-lint-enable no-invalid-interactive --}} {{!-- template-lint-enable no-invalid-interactive --}}
<GhUploader <GhUploader
@ -40,10 +38,6 @@
<span class="gh-editor-hidden-indicator" data-tooltip="Feature image and post title are hidden on page"> <span class="gh-editor-hidden-indicator" data-tooltip="Feature image and post title are hidden on page">
{{svg-jar "eye-closed"}} {{svg-jar "eye-closed"}}
</span> </span>
{{else}}
<span class="gh-editor-feature-image-indicator" data-tooltip="A feature image is publicly visible to anyone">
{{svg-jar "feature-image"}}
</span>
{{/if}} {{/if}}
<div class="gh-editor-feature-image"> <div class="gh-editor-feature-image">
<img src={{@image}} alt={{@alt}} role={{if @alt "img" "presentation"}} class="{{if @isHidden "faded"}}"> <img src={{@image}} alt={{@alt}} role={{if @alt "img" "presentation"}} class="{{if @isHidden "faded"}}">
@ -87,7 +81,7 @@
</div> </div>
{{else}} {{else}}
{{!-- no-image state --}} {{!-- no-image state --}}
<div class="flex flex-row items-center {{if this.hideButton "invisible"}}"> <div class="flex flex-row items-center">
{{#if this.canDrop}} {{#if this.canDrop}}
<div class="gh-editor-feature-image-add-button"><span>Drop to upload feature image</span></div> <div class="gh-editor-feature-image-add-button"><span>Drop to upload feature image</span></div>
{{else}} {{else}}

View file

@ -15,15 +15,10 @@ export default class GhEditorFeatureImageComponent extends Component {
@service settings; @service settings;
@tracked isEditingAlt = false; @tracked isEditingAlt = false;
@tracked isHovered = false;
@tracked captionInputFocused = false; @tracked captionInputFocused = false;
@tracked showUnsplashSelector = false; @tracked showUnsplashSelector = false;
@tracked canDrop = false; @tracked canDrop = false;
get hideButton() {
return !this.canDrop && !this.isHovered && !this.args.forceButtonDisplay;
}
get caption() { get caption() {
const content = this.args.caption; const content = this.args.caption;
if (!content) { if (!content) {

View file

@ -593,6 +593,7 @@ body[data-user-is-dragging] .gh-editor-feature-image-dropzone {
width: 1em; width: 1em;
height: 1em; height: 1em;
margin-left: 24px; margin-left: 24px;
margin-bottom: 2px;
line-height: 1.2; line-height: 1.2;
} }