Fixes a race condition where the navbar service can look for
eg-accesskey attributes before all of the elements that have
them meet the conditions to show up in the DOM.
To test
-------
[1] From an AngularJS part of the staff interface, note that
hitting F8 sometimes does not perform the retrieve
last patron action, nor does F8 show up on the list of
hot keys when you hit "?" outside of an input.
[2] Apply the patch and repeat step 1. This time, the F8
hotkey should consistently work.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
$scope.showAngularCatalog =
s['ui.staff.angular_catalog.enabled'];
+ }).then(function() {
+ // need to defer initialization of hotkeys to this point
+ // as it depends on various settings.
+ $timeout(function(){find_accesskeys($element)});
});
+ } else {
+ // fallback initialization of hotkeys
+ $timeout(function(){find_accesskeys($element)});
}
- // need to defer initialization of hotkeys to this point
- // as some of them are conditional on whether one is logged in
- // or is working in offline circulation mode
- $timeout(function(){find_accesskeys($element)});
}
);
}