This commit is contained in:
Harvey authored and Harvey Zack committed 2022-02-11 11:20:54 +08:00
1 parent eaeb74ef7a
commit 030913dc48
4 files changed
+27 -9

No files matched your search

+14 -3
View File
@@ -1,6 +1,5 @@
import Component from '../utils/component';
import { append, addClass, setStyle, inverseClass } from '../utils/dom';
import { append, addClass, setStyle, inverseClass, includeFromEvent } from '../utils';
import flip from './flip';
import aspectRatio from './aspectRatio';
import playbackRate from './playbackRate';
@@ -30,7 +29,8 @@ export default class Setting extends Component {
const {
option,
template: { $setting },
events: { proxy },
template: { $setting, $player },
} = art;
this.art = art;
@@ -66,6 +66,17 @@ export default class Setting extends Component {
this.show = false;
this.init(this.option);
});
proxy($player, 'click', (event) => {
if (
this.show &&
!includeFromEvent(event, art.controls.setting) &&
!includeFromEvent(event, this.$parent)
) {
this.show = false;
this.init(this.option);
}
});
}
}