mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-08-30 06:08:10 +02:00
js: scroll to highlighted object
This commit is contained in:
parent
6642d8cf74
commit
0c0694605c
@ -108,6 +108,7 @@ pre.generated-config {
|
||||
|
||||
|
||||
.highlight {
|
||||
border-bottom: 1px dashed @gray-light;
|
||||
&::before {
|
||||
// icon: right-big
|
||||
font-family: 'ifont';
|
||||
|
@ -239,6 +239,7 @@
|
||||
this.backupAllExtensibleSetDefaultValues($container);
|
||||
this.putFocusOnFirstObjectTypeElement($container);
|
||||
this.highlightFormErrors($container);
|
||||
this.scrollHighlightIntoView($container);
|
||||
this.hideInactiveFormDescriptions($container);
|
||||
if (iid = $container.data('activeExtensibleEntry')) {
|
||||
$('#' + iid).focus();
|
||||
@ -263,6 +264,17 @@
|
||||
}
|
||||
},
|
||||
|
||||
scrollHighlightIntoView: function ($container) {
|
||||
$hl = $container.find('.highlight');
|
||||
$content = $container.find('> div.content');
|
||||
|
||||
if ($hl.length) {
|
||||
$container.animate({
|
||||
scrollTop: $hl.offset().top - $content.offset().top
|
||||
}, 700);
|
||||
}
|
||||
},
|
||||
|
||||
backupAllExtensibleSetDefaultValues: function($container) {
|
||||
var self = this;
|
||||
$container.find('.extensible-set').each(function (idx, eSet) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user