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

@@ -134,15 +134,22 @@ var pwPanels = {
// allow for use of data-href or href attribute that references URL to load in panel
if(typeof panelURL == 'undefined' || !panelURL.length) panelURL = $toggler.attr('href');
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=';
if($toggler !== null && $toggler.hasClass('pw-panel-links')) {
panelURL += '2'; // don't update target of links in panel
} else {
panelURL += '1'; // update target of links in panel
}
panelURL += hash;
}
var $icon = $('<i />')

File diff suppressed because one or more lines are too long