1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-21 22:06:12 +02:00

Fix issue processwire/processwire-issues#325 panel.js and URL fragments fix

This commit is contained in:
Ryan Cramer
2017-07-28 10:10:16 -04:00
parent 71896f463e
commit 277674db23
2 changed files with 10 additions and 3 deletions

View File

@@ -136,6 +136,12 @@ var pwPanels = {
if(typeof panelURL == 'undefined' || !panelURL.length) panelURL = $toggler.attr('href'); if(typeof panelURL == 'undefined' || !panelURL.length) panelURL = $toggler.attr('href');
if(typeof panelURL != 'undefined' && panelURL.length) { if(typeof panelURL != 'undefined' && panelURL.length) {
var hash = '';
if(panelURL.indexOf('#') > -1) {
var parts = panelURL.split('#');
panelURL = parts[0];
hash = '#' + parts[1];
}
panelURL += (panelURL.indexOf('?') > -1 ? '&' : '?') + 'modal=panel&pw_panel='; panelURL += (panelURL.indexOf('?') > -1 ? '&' : '?') + 'modal=panel&pw_panel=';
if($toggler !== null && $toggler.hasClass('pw-panel-links')) { if($toggler !== null && $toggler.hasClass('pw-panel-links')) {
@@ -143,6 +149,7 @@ var pwPanels = {
} else { } else {
panelURL += '1'; // update target of links in panel panelURL += '1'; // update target of links in panel
} }
panelURL += hash;
} }
var $icon = $('<i />') var $icon = $('<i />')

File diff suppressed because one or more lines are too long