Skip to content

Commit

Permalink
Merge pull request #887 from webinmd/tab-settings-hash
Browse files Browse the repository at this point in the history
Добавил хэш в url для табов настроек
  • Loading branch information
biz87 authored Jun 11, 2023
2 parents d61302a + 07bc6a1 commit bb3f25e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions assets/components/minishop2/js/mgr/settings/settings.panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,25 @@ miniShop2.panel.Settings = function (config) {
activeTab: this.items.indexOf(this.getActiveTab())
};
},
listeners: {
tabchange: function (tabPanel, tab) {
window.location.hash = '#tab-' + tab.id;
},
render: function (tabPanel) {
let tabHash = window.location.hash.substring(1);
if (tabHash) {
let tabId = tabHash.replace("tab-", "");
let tab = tabPanel.get(tabId);
if (tab) {
tabPanel.setActiveTab(tab);
}
}
}
},
items: [{
title: _('ms2_deliveries'),
layout: 'anchor',
id: 'deliveries',
items: [{
html: _('ms2_deliveries_intro'),
bodyCssClass: 'panel-desc',
Expand All @@ -30,6 +46,7 @@ miniShop2.panel.Settings = function (config) {
}, {
title: _('ms2_payments'),
layout: 'anchor',
id: 'payments',
items: [{
html: _('ms2_payments_intro'),
bodyCssClass: 'panel-desc',
Expand All @@ -40,6 +57,7 @@ miniShop2.panel.Settings = function (config) {
}, {
title: _('ms2_statuses'),
layout: 'anchor',
id: 'statuses',
items: [{
html: _('ms2_statuses_intro'),
bodyCssClass: 'panel-desc',
Expand All @@ -50,6 +68,7 @@ miniShop2.panel.Settings = function (config) {
}, {
title: _('ms2_vendors'),
layout: 'anchor',
id: 'vendors',
items: [{
html: _('ms2_vendors_intro'),
bodyCssClass: 'panel-desc',
Expand All @@ -60,6 +79,7 @@ miniShop2.panel.Settings = function (config) {
}, {
title: _('ms2_links'),
layout: 'anchor',
id: 'links',
items: [{
html: _('ms2_links_intro'),
bodyCssClass: 'panel-desc',
Expand All @@ -70,6 +90,7 @@ miniShop2.panel.Settings = function (config) {
}, {
title: _('ms2_options'),
layout: 'anchor',
id: 'options',
items: [{
html: _('ms2_options_intro'),
bodyCssClass: 'panel-desc',
Expand Down

0 comments on commit bb3f25e

Please sign in to comment.