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:
Christian Williams 2012-11-14 18:11:02 -08:00 committed by Inez Korczyński
parent 918c0e3266
commit fcfca947a9

View file

@ -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() );