Skip to content
Snippets Groups Projects
Commit f5318ced authored by Ere Maijala's avatar Ere Maijala Committed by Robert Lange
Browse files

Fix check for element length in account_ajax.js.

Also adds check for INACTIVE sub.
parent e326dc81
No related merge requests found
...@@ -50,12 +50,16 @@ VuFind.register('account', function Account() { ...@@ -50,12 +50,16 @@ VuFind.register('account', function Account() {
var accountStatus = ICON_LEVELS.NONE; var accountStatus = ICON_LEVELS.NONE;
for (var sub in _submodules) { for (var sub in _submodules) {
if (Object.prototype.hasOwnProperty.call(_submodules, sub)) { if (Object.prototype.hasOwnProperty.call(_submodules, sub)) {
var status = _getStatus(sub);
if (status === INACTIVE) {
continue;
}
var $element = $(_submodules[sub].selector); var $element = $(_submodules[sub].selector);
if (!$element) { if ($element.length === 0) {
// This could happen if the DOM is changed dynamically
_statuses[sub] = INACTIVE; _statuses[sub] = INACTIVE;
continue; continue;
} }
var status = _getStatus(sub);
if (status === MISSING) { if (status === MISSING) {
$element.addClass('hidden'); $element.addClass('hidden');
} else { } else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment