home_ou : egCore.org.tree()
};
+ // FIXME: kludgy; used to prevent sound effect on page load for empty search
+ var first_run = true;
+
// last used patron search form element
var lastFormElement;
).then(
function() {
// hide progress bar on 0-hits searches
+ if ($scope.show_search_progress && ! first_run) {
+ egCore.audio.play('warning.patron.by_search');
+ }
+ first_run = false;
$scope.show_search_progress = false;
deferred.resolve();
},
- null, // onerror
+ function() { // onerror
+ egCore.audio.play('error.patron.by_search');
+ },
function(user) {
// hide progress bar as soon as the first result appears.
+ if ($scope.show_search_progress) {
+ egCore.audio.play('success.patron.by_search');
+ }
$scope.show_search_progress = false;
patronSvc.localFlesh(user); // inline
patronSvc.patrons.push(user);