2016-01-02 14:19:11 +01:00
|
|
|
<link rel="import" href="sound-notification.html">
|
|
|
|
<script>
|
|
|
|
'use strict';
|
2016-06-23 11:03:49 -06:00
|
|
|
Snapdrop = window.Snapdrop || {};
|
|
|
|
Snapdrop.SoundNotificationBehavior = {
|
2016-01-02 14:19:11 +01:00
|
|
|
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>
|