From: Jason Etheridge Date: Thu, 23 Mar 2017 21:03:40 +0000 (-0400) Subject: webstaff: warning sound for empty patron search results X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3c2b5d62086067ac7d2124d3e4193f7ae547b25c;p=working%2FEvergreen.git webstaff: warning sound for empty patron search results Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index 1dc380f89b..d9a4e9c380 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -822,6 +822,9 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, 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; @@ -981,12 +984,21 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, ).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);