mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
js: play smooth with autosubmit, re-focus sets
This commit is contained in:
parent
07e6e63517
commit
14001a6631
@ -34,6 +34,12 @@
|
||||
if (el.name.match(/__MOVE_UP$/)) {
|
||||
var $li = $(el).closest('li');
|
||||
var $prev = $li.prev()
|
||||
if ($li.find('input[type=text].autosubmit')) {
|
||||
if (iid = $prev.find('input[type=text]').attr('id')) {
|
||||
$li.closest('.container').data('activeExtensibleEntry', iid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if ($prev.length) {
|
||||
$prev.before($li.detach());
|
||||
this.fixRelatedActions($li.closest('ul'));
|
||||
@ -44,6 +50,12 @@
|
||||
} else if (el.name.match(/__MOVE_DOWN$/)) {
|
||||
var $li = $(el).closest('li');
|
||||
var $next = $li.next()
|
||||
if ($li.find('input[type=text].autosubmit')) {
|
||||
if (iid = $next.find('input[type=text]').attr('id')) {
|
||||
$li.closest('.container').data('activeExtensibleEntry', iid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if ($next.length && ! $next.find('.extend-set').length) {
|
||||
$next.after($li.detach());
|
||||
this.fixRelatedActions($li.closest('ul'));
|
||||
@ -152,6 +164,10 @@
|
||||
this.putFocusOnFirstObjectTypeElement($container);
|
||||
this.highlightFormErrors($container);
|
||||
this.hideInactiveFormDescriptions($container);
|
||||
if (iid = $container.data('activeExtensibleEntry')) {
|
||||
$('#' + iid).focus();
|
||||
$container.removeData('activeExtensibleEntry');
|
||||
}
|
||||
},
|
||||
|
||||
restoreContainerFieldsets: function($container)
|
||||
|
Loading…
x
Reference in New Issue
Block a user