2019-05-01 17:13:49 +03:00
|
|
|
import Service from '@ember/service';
|
2020-10-21 14:16:04 +03:00
|
|
|
import {tracked} from '@glimmer/tracking';
|
2019-05-01 17:13:49 +03:00
|
|
|
|
2020-10-21 14:16:04 +03:00
|
|
|
export default class KoenigUiService extends Service {
|
|
|
|
@tracked captionHasFocus = false;
|
|
|
|
@tracked inputHasFocus = false;
|
|
|
|
@tracked isDragging = false;
|
|
|
|
|
|
|
|
#focusedCaption = null;
|
2019-05-01 17:13:49 +03:00
|
|
|
|
|
|
|
captionGainedFocus(caption) {
|
2020-10-21 14:16:04 +03:00
|
|
|
this.captionHasFocus = true;
|
|
|
|
this.#focusedCaption = caption;
|
|
|
|
}
|
2019-05-01 17:13:49 +03:00
|
|
|
|
|
|
|
captionLostFocus(caption) {
|
2020-10-21 14:16:04 +03:00
|
|
|
if (this.#focusedCaption === caption) {
|
|
|
|
this.captionHasFocus = false;
|
|
|
|
this.#focusedCaption = null;
|
2019-05-01 17:13:49 +03:00
|
|
|
}
|
|
|
|
}
|
2020-10-21 14:16:04 +03:00
|
|
|
}
|