Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/projects/behavior-project-boards.js
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | JX.behavior('project-boards', function(config, statics) { | ||||
var header_keys = config.headerKeys; | var header_keys = config.headerKeys; | ||||
for (var header_phid in header_keys) { | for (var header_phid in header_keys) { | ||||
board.getCardTemplate(header_phid) | board.getCardTemplate(header_phid) | ||||
.setHeaderKey(config.order, header_keys[header_phid]); | .setHeaderKey(config.order, header_keys[header_phid]); | ||||
} | } | ||||
board.start(); | board.start(); | ||||
// In Safari, we can only play sounds that we've already loaded, and we can | |||||
// only load them in response to an explicit user interaction like a click. | |||||
var sounds = config.preloadSounds; | |||||
var listener = JX.Stratcom.listen('mousedown', null, function() { | |||||
amckinley: This callback only gets triggered on the first `mousedown`, right? | |||||
Done Inline ActionsIt runs on each click, but sounds is empty after the first time so it's effectively a no-op. (There's currently no super convenient way to do a listenOnce() kind of thing. The callback could unregister the listener, but the cost of keeping this callback around should be insignificant.) epriestley: It runs on each click, but `sounds` is empty after the first time so it's effectively a no-op. | |||||
for (var ii = 0; ii < sounds.length; ii++) { | |||||
JX.Sound.load(sounds[ii]); | |||||
} | |||||
// Remove this callback once it has run once. | |||||
listener.remove(); | |||||
}); | |||||
}); | }); |
This callback only gets triggered on the first mousedown, right?