N°3939 - Keep focus on current tab on object modification

This commit is contained in:
Molkobain
2021-05-11 16:34:54 +02:00
parent 5977c5dd9e
commit c0ec7e02f8
2 changed files with 11 additions and 16 deletions

View File

@@ -367,21 +367,6 @@ JS
SetUserPreference(parent_id+'_'+this.id+'_height', $(this).height(), true); // true => persistent
}
} );
// Shortcut menu actions
$('.actions_button a').on('click', function() {
aMatches = /#(.*)$/.exec(window.location.href);
if (aMatches != null)
{
currentHash = aMatches[1];
if ( /#(.*)$/.test(this.href))
{
this.href = this.href.replace(/#(.*)$/, '#'+currentHash);
}
}
});
// End of Tabs handling
PrepareWidgets();

View File

@@ -5,7 +5,6 @@ $('#{{ oUIBlock.GetId() }}').on('edit_object', function(){
$(this).find('button[name="UI:Menu:Modify"]').click();
});
$('#{{ oUIBlock.GetId() }}').on('delete_object', function(){
$(this).find('button[name="UI:Menu:Delete"]').click();
});
@@ -22,3 +21,14 @@ $('#{{ oUIBlock.GetId() }}').on('save_object', function(){
$(this).find('button[type="submit"][name="submit"][value="submit"]').click();
});
{% endif %}
// Keep URL's hash parameters when clicking on a link of the header
$('#{{ oUIBlock.GetId() }}').on('click', '[data-role="ibo-panel--header-right"] a', function() {
aMatches = /#(.*)$/.exec(window.location.href);
if (aMatches != null) {
currentHash = aMatches[1];
if (/#(.*)$/.test(this.href)) {
this.href = this.href.replace(/#(.*)$/, '#'+currentHash);
}
}
});