Last modified: 2011-05-15 10:37:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29073, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27073 - ResourceLoaderDynamicStyles should be dynamically appended to the document if it doesn't exist
ResourceLoaderDynamicStyles should be dynamically appended to the document if...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-31 18:10 UTC by Michael Dale
Modified: 2011-05-15 10:37 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch for adding getMarker (1.70 KB, patch)
2011-04-19 17:49 UTC, Michael Dale
Details

Description Michael Dale 2011-01-31 18:10:13 UTC
You have the code: 
// Marker element for adding dynamic styles
var $marker = $( 'head meta[name=ResourceLoaderDynamicStyles]' );

You should instead have: 
var $marker = null and then use this.getCssMarker() or getCssMarker() and locally cache the selector so you can lazy initialize the target ( and do things like add the target to the page if its missing )

something like: 

// Marker element for adding dynamic styles
var $marker = null ; // lazy init
var getMarker = function(){
if( $marker ){
	return $marker;
}
$marker = $( 'head meta[name=ResourceLoaderDynamicStyles]' )
if( ! $marker.length ){
	$marker = $( '<meta />').attr( 'name', 'ResourceLoaderDynamicStyles' )
		  .appendTo( 'head' );
	}
return $marker;
};
Comment 1 Michael Dale 2011-04-19 17:49:03 UTC
Created attachment 8429 [details]
patch for adding getMarker

here is the comment in patch form .. if that helps.
Comment 2 p858snake 2011-04-30 00:09:36 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 3 Krinkle 2011-05-15 10:37:11 UTC
Fixed in r88143.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links