Skip to content

Commit

Permalink
Fix check for element length in account_ajax.js.
Browse files Browse the repository at this point in the history
Also adds check for INACTIVE sub.
  • Loading branch information
EreMaijala authored and demiankatz committed Dec 4, 2020
1 parent 14edf89 commit e91c4ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions themes/bootstrap3/js/account_ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ VuFind.register('account', function Account() {
var accountStatus = ICON_LEVELS.NONE;
for (var sub in _submodules) {
if (Object.prototype.hasOwnProperty.call(_submodules, sub)) {
var status = _getStatus(sub);
if (status === INACTIVE) {
continue;
}
var $element = $(_submodules[sub].selector);
if (!$element) {
if ($element.length === 0) {
// This could happen if the DOM is changed dynamically
_statuses[sub] = INACTIVE;
continue;
}
var status = _getStatus(sub);
if (status === MISSING) {
$element.addClass('hidden');
} else {
Expand Down

0 comments on commit e91c4ef

Please sign in to comment.