LP#1642378 Webstaff org selector misc. repairs
authorBill Erickson <berickxx@gmail.com>
Mon, 27 Feb 2017 21:43:09 +0000 (16:43 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 3 Mar 2017 16:37:11 +0000 (11:37 -0500)
commit0dd2f1a257acacf7e9fd77a8ca4e93313dce596c
tree39fde79ac93be4614c01b9dd8df09de504d0e507
parentf5955b822180d7f5eb1b0f92e5f6eeef7b62b2bc
LP#1642378 Webstaff org selector misc. repairs

1. Always apply default values after egStartup.go() has completed.
   Among other things, this prevents the occaisonal "cannot call ws_ou()
   on an undefined value" errors bubbling up from the org selector
   when an attempt to set default values occured before egAuth had
   retrieved the user (which occurs during startup).

2. For consistency, always run the $scope.onchange handler on initial
   page load when a selected value and change handler are defined.
   Similar to #1 above, the initial onchange always fires after
   egStartup has completed.

3. Run the change handler in a $timeout so that the $scope.selected
   value has a chance to propagate to the calling controller's $scope.
   Otherwise, the the calling controller has to manually track the
   selected value (which partially defeats the purpose of having this
   directive in the first place).

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/web/js/ui/default/staff/services/ui.js