Skip to content
Snippets Groups Projects
Commit 8da88f79 authored by Robert Lange's avatar Robert Lange
Browse files

refs #21905 [fid_adlr]

* create: use correct finc label for link to saved list
* delete:
** make deleting of list items more robust
** do not reload page, try delete list entry by javascript furthermore
** new: reload page when list item could not be deleted
** set focus on next element after delete

* adapt finc 20379
parent 813f0629
No related merge requests found
......@@ -71,7 +71,6 @@ Authors/Corporations = "Beteiligte"
Format = "Medientyp"
view_worldcat = "Auch in diesen Bibliotheken vorhanden"
Description = "weitere Informationen"
go_to_list = "Zurück zur Ergebnisliste"
#myresearch-menu
contact_adlr = "Kontakt zu adlr.link"
......
......@@ -69,7 +69,6 @@ basic_search_keep_filters = "Retain Filters"
Format = "Media Type"
view_worldcat = "Also available in these libraries"
Description = "further information"
go_to_list = "Back to results"
#myresearch-menu
contact_adlr = "Contact adlr.link"
......
......@@ -207,6 +207,11 @@ VuFind.register('lightbox', function Lightbox() {
ajax({ url: _currentUrl || _originalUrl });
}
// finc: restore focus after deleting records, #20379 #21905
function setOrigin(origin) {
_origin = origin;
}
/**
* Evaluate a callback
*/
......@@ -446,6 +451,7 @@ VuFind.register('lightbox', function Lightbox() {
// Reset
reset: reset,
// Init
init: init
init: init,
setOrigin: setOrigin
};
});
......@@ -23,6 +23,6 @@
}
a {
color: $state-info-text;
color: $black;
}
}
......@@ -251,8 +251,18 @@
'delete':'<?=$this->escapeJs($id) ?>',
'source':'<?=$this->escapeJs($source) ?>',
'confirm':true
}, function(){
$('input[value=<?=$id?>]').parent().remove(0);
}, function() {
let rowToRemove = $('input[value=<?=$id?>]').parent();
if (rowToRemove && rowToRemove.length) {
let nextFocus = rowToRemove.next().first().find('input');
rowToRemove.remove(0);
if (nextFocus && nextFocus.length) {
VuFind.lightbox.setOrigin(nextFocus);
}
} else {
setTimeout('location.reload(true);', 2000);
}
<?php /* reset needed for possible old MyResearchController::mylistAction in instances withot clearMessages */ ?>
<?php if (null === $list_id) :?>
VuFind.lightbox.alert('<?= $this->transEsc('Item removed from favorites')?>', 'success');
......
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