mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Better Shield Logic
jQuery.css('float') returns different null values for Chrome and Firefox. This fix takes this into account and applies shields only to aliens and floated descendants. Change-Id: I4c1db148043ee95991a17720dee8febad62c415a
This commit is contained in:
parent
918c0e3266
commit
fcfca947a9
|
@ -52,9 +52,12 @@ ve.ce.AlienBlockNode.prototype.onUpdate = function () {
|
|||
var $shieldTemplate = this.constructor.static.$shieldTemplate;
|
||||
this.$.html( this.model.getAttribute( 'html' ) );
|
||||
this.$.add( this.$.find( '*' ) ).each( function () {
|
||||
var $this = $(this);
|
||||
var $this = $( this );
|
||||
if ( this.nodeType === Node.ELEMENT_NODE ) {
|
||||
if ( !$this.css( 'float' ) && !$this.hasClass( 've-ce-alienBlockNode' ) ) {
|
||||
if (
|
||||
( $this.css( 'float' ) === 'none' || $this.css( 'float' ) === '' ) &&
|
||||
!$this.hasClass( 've-ce-alienBlockNode' )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
$this.append( $shieldTemplate.clone() );
|
||||
|
|
Loading…
Reference in a new issue