mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-23 16:26:17 -04:00
Add sound notifications
This commit is contained in:
parent
ddee78fe19
commit
ce61dc7c60
5 changed files with 83 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
<link rel="import" href="sound-notification.html">
|
||||
<script>
|
||||
'use strict';
|
||||
Chat = window.Chat || {};
|
||||
Chat.SoundNotificationBehavior = {
|
||||
sounds: function() {
|
||||
var sounds = document.querySelector('sound-notification');
|
||||
if (!sounds) {
|
||||
sounds = Polymer.Base.create('sound-notification');
|
||||
document.body.appendChild(sounds);
|
||||
}
|
||||
return sounds;
|
||||
},
|
||||
attached: function() {
|
||||
//lazy load sound files
|
||||
setTimeout(function() {
|
||||
this.sounds();
|
||||
}.bind(this), 1000);
|
||||
},
|
||||
playSound: function(e) {
|
||||
this.sounds().play();
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue