mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
489f45155d
no issue - show the toolbar icon for any `<KoenigCard>` instance that has the `saveAsSnippet` action passed to it - currently that's all cards except the HR card because that's a primitive element rather than containing any user-defined content - add `koenigUi.inputHasFocus` so that card toolbars can be hidden when the snippet input is displayed
23 lines
573 B
JavaScript
23 lines
573 B
JavaScript
import Service from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class KoenigUiService extends Service {
|
|
@tracked captionHasFocus = false;
|
|
@tracked inputHasFocus = false;
|
|
@tracked isDragging = false;
|
|
|
|
#focusedCaption = null;
|
|
|
|
captionGainedFocus(caption) {
|
|
this.captionHasFocus = true;
|
|
this.#focusedCaption = caption;
|
|
}
|
|
|
|
captionLostFocus(caption) {
|
|
if (this.#focusedCaption === caption) {
|
|
this.captionHasFocus = false;
|
|
this.#focusedCaption = null;
|
|
}
|
|
}
|
|
}
|