From c3eed99cdde23fc521149b87fa7b2a3f4e8ed477 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 27 Mar 2015 10:13:57 +0000 Subject: [PATCH] Introduce new target type called "_browser", in order to specify browser default link handling - Description widget using href, the default target would be _browser - Call filemanager egw.open with target _browser --- etemplate/js/et2_widget_description.js | 2 +- filemanager/js/app.js | 2 +- phpgwapi/js/jsapi/egw_open.js | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/etemplate/js/et2_widget_description.js b/etemplate/js/et2_widget_description.js index 53acba93d5..00c1544df1 100644 --- a/etemplate/js/et2_widget_description.js +++ b/etemplate/js/et2_widget_description.js @@ -70,7 +70,7 @@ var et2_description = expose(et2_baseWidget.extend([et2_IDetachedDOM], "extra_link_target": { "name": "Link target", "type": "string", - "default": "_self", + "default": "_browser", "description": "Link target for href attribute" }, "extra_link_popup": { diff --git a/filemanager/js/app.js b/filemanager/js/app.js index 3a96760661..4d48a474db 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -745,7 +745,7 @@ app.classes.filemanager = AppJS.extend( } else { - egw.open({path: path, type: data.data.mime}, 'file'); + egw.open({path: path, type: data.data.mime}, 'file','view',null,'_browser'); } return false; }, diff --git a/phpgwapi/js/jsapi/egw_open.js b/phpgwapi/js/jsapi/egw_open.js index 28da36d8cc..d9f28c6aef 100644 --- a/phpgwapi/js/jsapi/egw_open.js +++ b/phpgwapi/js/jsapi/egw_open.js @@ -334,27 +334,18 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) } else if ((typeof _target == 'undefined' || _target == '_self' || typeof this.link_app_list()[_target] != "undefined")) { - // No mime type registered, set target properly based on browsing environment - if (!mime_info) - { - _target = egwIsMobile()?'_self':'_blank'; - } if(_target == '_self') { // '_self' isn't allowed, but we can handle it _target = undefined; } - else - { - return _wnd.open(url, _target); - } // Use framework's link handler, if present return this.link_handler(url,_target); } else { // No mime type registered, set target properly based on browsing environment - if (!mime_info) + if (_target == '_browser') { _target = egwIsMobile()?'_self':'_blank'; }