mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-30 18:14:21 +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' ) {
|
if ( $this->type === 'styles' || $this->type === 'general' ) {
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
if ( $this->styles && !$this->scripts ) {
|
if ( $this->styles && !$this->scripts && !$this->dependencies ) {
|
||||||
// Similar to ResourceLoaderWikiModule default
|
// Similar to ResourceLoaderWikiModule default
|
||||||
return 'styles';
|
return 'styles';
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,12 @@ class GadgetsTest extends MediaWikiTestCase {
|
||||||
'general',
|
'general',
|
||||||
ResourceLoaderModule::LOAD_GENERAL,
|
ResourceLoaderModule::LOAD_GENERAL,
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'Default (styles only with dependencies)',
|
||||||
|
'* foo[ResourceLoader|dependencies=jquery.ui]|bar.css',
|
||||||
|
'',
|
||||||
|
ResourceLoaderModule::LOAD_GENERAL,
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'Styles type (mixed)',
|
'Styles type (mixed)',
|
||||||
'* foo[ResourceLoader|type=styles]|bar.css|bar.js',
|
'* foo[ResourceLoader|type=styles]|bar.css|bar.js',
|
||||||
|
|
Loading…
Reference in a new issue