mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
use same method (prefer .min.js over .js) for app.js include in Etemplate and Framework
fixes double include of /mail/js/app.js and /mail/js/app.min.js
This commit is contained in:
parent
2be47ffce2
commit
d57fe03326
@ -234,13 +234,10 @@ class Etemplate extends Etemplate\Widget\Template
|
||||
{
|
||||
// check if application of template has a app.js file --> load it, preferring local min file if there
|
||||
list($app) = explode('.',$this->name);
|
||||
if (file_exists(EGW_SERVER_ROOT.'/'.$app.'/js/app.min.js'))
|
||||
if (file_exists(EGW_SERVER_ROOT.($path = '/'.$app.'/js/app.min.js')) ||
|
||||
file_exists(EGW_SERVER_ROOT.($path = '/'.$app.'/js/app.js')))
|
||||
{
|
||||
Framework::includeJS('.','app.min',$app,true);
|
||||
}
|
||||
else if (file_exists(EGW_SERVER_ROOT.'/'.$app.'/js/app.js'))
|
||||
{
|
||||
Framework::includeJS('.','app',$app,true);
|
||||
Framework::includeJS($path);
|
||||
}
|
||||
// Category styles
|
||||
Categories::css($app);
|
||||
|
@ -1490,7 +1490,7 @@ abstract class Framework extends Framework\Extra
|
||||
* @param string $app ='phpgwapi' application directory to search - default = phpgwapi
|
||||
* @param boolean $append =true should the file be added
|
||||
*/
|
||||
static function includeJS($package, $file=null, $app='phpgwapi', $append=true)
|
||||
static function includeJS($package, $file=null, $app='api', $append=true)
|
||||
{
|
||||
self::$js_include_mgr->include_js_file($package, $file, $app, $append);
|
||||
}
|
||||
@ -1584,7 +1584,11 @@ abstract class Framework extends Framework\Extra
|
||||
}
|
||||
|
||||
// try to add app specific js file
|
||||
self::includeJS('.', 'app', $app);
|
||||
if (file_exists(EGW_SERVER_ROOT.($path = '/'.$app.'/js/app.min.js')) ||
|
||||
file_exists(EGW_SERVER_ROOT.($path = '/'.$app.'/js/app.js')))
|
||||
{
|
||||
self::includeJS($path);
|
||||
}
|
||||
|
||||
// add all js files from Framework::includeJS()
|
||||
$files = Framework\Bundle::js_includes(self::$js_include_mgr->get_included_files());
|
||||
|
Loading…
Reference in New Issue
Block a user