BUGFIX Replaced logic for checking external URLs in CMS Menu with more stable jQuery Mobile codebase (fixes problems on IE not loading menu entries via ajax) (#7002)

This commit is contained in:
Ingo Schommer 2012-03-30 15:22:40 +02:00
parent 58433d38ce
commit c518a19ec2
3 changed files with 6 additions and 14 deletions

View File

@ -159,10 +159,10 @@
self.submitForm_responseHandler(form, xmlhttp.responseText, status, xmlhttp, formData);
}
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it.
if(window.History.enabled) {
var url = xmlhttp.getResponseHeader('X-ControllerURL');
if(url) window.history.replaceState({}, '', url);
if(url) window.History.replaceState({}, '', url);
}
// Re-init tabs (in case the form tag itself is a tabset)
@ -287,7 +287,7 @@
var url = $(node).find('a:first').attr('href');
if(url && url != '#') {
if($(node).find('a:first').is(':internal')) url = url = $.path.makeUrlAbsolute(url, $('base').attr('href'));
if($.path.isExternal($(node).find('a:first'))) url = url = $.path.makeUrlAbsolute(url, $('base').attr('href'));
// Reload only edit form if it exists (side-by-side view of tree and edit view), otherwise reload whole panel
if(container.find('.cms-edit-form').length) {
url += '?cms-view-form=1';

View File

@ -207,16 +207,16 @@
onclick: function(e) {
// Only catch left clicks, in order to allow opening in tabs.
// Ignore external links, fallback to standard link behaviour
if(e.which > 1 || this.is(':external')) return;
var isExternal = $.path.isExternal(this.attr('href'));
if(e.which > 1 || isExternal) return;
e.preventDefault();
var item = this.getMenuItem();
var url = this.attr('href');
if(this.is(':internal')) url = $('base').attr('href') + url;
if(!isExternal) url = $('base').attr('href') + url;
var children = item.find('li');
if(children.length) {
children.first().find('a').click();
} else {
@ -261,8 +261,4 @@
});
});
// Internal Helper
$.expr[':'].internal = function(obj){return obj.href.match(/^mailto\:/) || (obj.hostname == location.hostname);};
$.expr[':'].external = function(obj){return !$(obj).is(':internal');};
}(jQuery));

View File

@ -232,8 +232,4 @@
};
$.path = path;
// Internal Helper
$.expr[':'].internal = function(obj){return obj.href.match(/^mailto\:/) || (obj.hostname == location.hostname);};
$.expr[':'].external = function(obj){return !$(obj).is(':internal')};
}(jQuery));