PairDrop/app/elements/sound-notification/sound-notification-behavior.html
Robin Linus 78dd776426 Rename global variable 'Chat' to 'Snapdrop'
Initially a lot of code was copied from another project. This lead to confusing naming conventions.
2016-10-17 01:40:50 +02:00

24 lines
645 B
HTML

<link rel="import" href="sound-notification.html">
<script>
'use strict';
Snapdrop = window.Snapdrop || {};
Snapdrop.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>