mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-13 17:53:22 +00:00
Default to type=general for styles-only gadgets having dependencies
Bug: T147726 Change-Id: I4153851b0e2f5cc067b1f31a7cd80f73d0620d7c
This commit is contained in:
parent
01f5977286
commit
906aaeeb82
|
@ -298,7 +298,7 @@ class Gadget {
|
|||
if ( $this->type === 'styles' || $this->type === 'general' ) {
|
||||
return $this->type;
|
||||
}
|
||||
if ( $this->styles && !$this->scripts ) {
|
||||
if ( $this->styles && !$this->scripts && !$this->dependencies ) {
|
||||
// Similar to ResourceLoaderWikiModule default
|
||||
return 'styles';
|
||||
}
|
||||
|
|
|
@ -84,6 +84,12 @@ class GadgetsTest extends MediaWikiTestCase {
|
|||
'general',
|
||||
ResourceLoaderModule::LOAD_GENERAL,
|
||||
),
|
||||
array(
|
||||
'Default (styles only with dependencies)',
|
||||
'* foo[ResourceLoader|dependencies=jquery.ui]|bar.css',
|
||||
'',
|
||||
ResourceLoaderModule::LOAD_GENERAL,
|
||||
),
|
||||
array(
|
||||
'Styles type (mixed)',
|
||||
'* foo[ResourceLoader|type=styles]|bar.css|bar.js',
|
||||
|
|
Loading…
Reference in a new issue