mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
dispatchEvent(new CustomEvent(...)) to fireEvent(...)
This commit is contained in:
parent
2d46eaa783
commit
44ee236709
9 changed files with 25 additions and 21 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import * as Links from 'Common/Links';
|
||||
import { doc, SettingsGet } from 'Common/Globals';
|
||||
import { doc, SettingsGet, fireEvent } from 'Common/Globals';
|
||||
|
||||
let notificator = null,
|
||||
player = null,
|
||||
|
|
@ -12,7 +12,7 @@ let notificator = null,
|
|||
player.src = url;
|
||||
player.play();
|
||||
name = name.trim();
|
||||
dispatchEvent(new CustomEvent('audio.start', {detail:name.replace(/\.([a-z0-9]{3})$/, '') || 'audio'}));
|
||||
fireEvent('audio.start', name.replace(/\.([a-z0-9]{3})$/, '') || 'audio');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ export const SMAudio = new class {
|
|||
|
||||
pause() {
|
||||
player && player.pause();
|
||||
dispatchEvent(new CustomEvent('audio.stop'));
|
||||
fireEvent('audio.stop');
|
||||
}
|
||||
|
||||
playMp3(url, name) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ export const
|
|||
return el;
|
||||
},
|
||||
|
||||
fireEvent = (name, detail) => dispatchEvent(new CustomEvent(name, {detail:detail})),
|
||||
|
||||
// keys
|
||||
keyScopeReal = ko.observable(Scope.All),
|
||||
keyScope = value => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue