- IE window.open does not support base href tag. Fixed.

This commit is contained in:
Paulo Gustavo Veiga 2012-08-15 21:05:44 -03:00
parent 70cebe97fc
commit dde7806b38
2 changed files with 63 additions and 57 deletions

View File

@ -223,7 +223,8 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('export', $msg('EXPORT'));
this._addButton('print', false, false, function () {
window.open('c/maps/' + mapId + '/print');
var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/"));
window.open(baseUrl + 'c/maps/' + mapId + '/print');
});
this._registerTooltip('print', $msg('PRINT'));

View File

@ -131,7 +131,10 @@ jQuery.fn.dialogForm = function(options) {
var resourceId = jqXHR.getResponseHeader("ResourceId");
var redirectUrl = options.redirect;
redirectUrl = redirectUrl.replace("{header.resourceId}", resourceId);
window.location = redirectUrl;
// Hack: IE ignore the base href tag ...
var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/"));
window.open(baseUrl + redirectUrl, '_self');
} else if (options.postUpdate) {
options.postUpdate(formData);
@ -263,7 +266,7 @@ $(function() {
$("#newBtn").click(
function () {
$("#new-dialog-modal").dialogForm({
redirect: "/c/maps/{header.resourceId}/edit",
redirect:"c/maps/{header.resourceId}/edit",
url:"service/maps"
});
});
@ -283,7 +286,7 @@ $(function() {
// Initialize dialog ...
$("#duplicate-dialog-modal").dialogForm({
redirect: "/c/maps/{header.resourceId}/edit",
redirect:"c/maps/{header.resourceId}/edit",
url:"service/maps/" + mapId
});
}
@ -344,7 +347,9 @@ $(function() {
$("#printBtn").click(function () {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
window.open('c/maps/' + mapIds[0] + '/print');
// Hack: IE ignore the base href tag ...
var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/"));
window.open(baseUrl + 'c/maps/' + mapIds[0] + '/print');
}
});