fixed not working _self target

This commit is contained in:
Ralf Becker 2013-09-02 13:25:00 +00:00
parent 7a0df1531d
commit e2cce43bad
3 changed files with 11 additions and 4 deletions

View File

@ -328,7 +328,9 @@ egw_json_request.prototype.sendRequest = function(_async, _callback, _sender)
dataType: 'json',
type: 'POST',
success: this.handleResponse,
error: function(_xmlhttp,_err) { window.console.error('Ajax request to ' + this.url + ' failed: ' + _err); }
error: function(_xmlhttp,_err) {
window.console.error('Ajax request to ' + this.url + ' failed: ' + _err);
}
});
}

View File

@ -441,7 +441,7 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
var self = this;
// bind change handler
select.change(function(){
if (this.value) self.open('', this.value, 'add', {}, this.value);
if (this.value) self.open('', this.value, 'add', {}, undefined, this.value);
this.value = '';
});
// need to load common translations for app-names

View File

@ -37,9 +37,10 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
* @param string type default "edit", possible "view", "view_list", "edit" (falls back to "view") and "add"
* @param object|string extra extra url parameters to append as object or string
* @param string target target of window to open
* @param string target_app target application to open in that tab
* @memberOf egw
*/
open: function(id_data, app, type, extra, target)
open: function(id_data, app, type, extra, target, target_app)
{
var id;
if(typeof target === 'undefined')
@ -126,7 +127,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
}
popup = app_registry[type+'_popup'];
}
return this.open_link(this.link(url, params), undefined, popup, target);
return this.open_link(this.link(url, params), target, popup, target_app);
},
/**
@ -172,6 +173,10 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
// Use framework's link handler, if present
return _wnd.egw_link_handler(url,_target);
}
else if (_target == '_self')
{
_wnd.location.href = url;
}
else
{
return _wnd.open(url, _target);