mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Fixing shields
Shields were being added twice. Switched the blank png to gif because the red IE background couldn't be replicated. Changed some styles from Alien to Protected. Change-Id: I9c62665e4e0dc54b8511749b9d2a629db7990a16
This commit is contained in:
parent
5c9b24eb1f
commit
30cfe6998f
|
@ -14,6 +14,15 @@
|
||||||
left: 0 !important;
|
left: 0 !important;
|
||||||
bottom: 0 !important;
|
bottom: 0 !important;
|
||||||
right: 0 !important;
|
right: 0 !important;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ve-ce-protectedNode::-moz-selection,
|
||||||
|
.ve-ce-protectedNode *::-moz-selection {
|
||||||
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ve-ce-protectedNode {
|
.ve-ce-protectedNode {
|
||||||
|
@ -105,20 +114,6 @@
|
||||||
|
|
||||||
/* ve.ce.AlienNode */
|
/* ve.ce.AlienNode */
|
||||||
|
|
||||||
/* Block aliens are unselectable */
|
|
||||||
.ve-ce-alienBlockNode,
|
|
||||||
.ve-ce-alienBlockNode * {
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-ce-alienBlockNode::-moz-selection,
|
|
||||||
.ve-ce-alienBlockNode *::-moz-selection {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fix weird Chrome native selection involving floated elements */
|
/* Fix weird Chrome native selection involving floated elements */
|
||||||
.ve-ce-alienBlockNode:before,
|
.ve-ce-alienBlockNode:before,
|
||||||
.ve-ce-alienBlockNode:after {
|
.ve-ce-alienBlockNode:after {
|
||||||
|
|
|
@ -33,9 +33,7 @@ ve.ce.ProtectedNode.static = {};
|
||||||
/**
|
/**
|
||||||
* Template for shield elements.
|
* Template for shield elements.
|
||||||
*
|
*
|
||||||
* Uses data URI to inject a 1x1 transparent PNG image into the DOM.
|
* Uses data URI to inject a 1x1 transparent GIF image into the DOM.
|
||||||
*
|
|
||||||
* Using transparent png instead of gif because IE 10 renders gif as solid red when used as img src.
|
|
||||||
*
|
*
|
||||||
* @property {jQuery}
|
* @property {jQuery}
|
||||||
* @static
|
* @static
|
||||||
|
@ -43,8 +41,7 @@ ve.ce.ProtectedNode.static = {};
|
||||||
*/
|
*/
|
||||||
ve.ce.ProtectedNode.static.$shieldTemplate = $( '<img>' )
|
ve.ce.ProtectedNode.static.$shieldTemplate = $( '<img>' )
|
||||||
.addClass( 've-ce-protectedNode-shield' )
|
.addClass( 've-ce-protectedNode-shield' )
|
||||||
.attr( 'src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAFElEQVR4' +
|
.attr( 'src', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' );
|
||||||
'XgXAAQ0AAABAMP1L30IDCPwC/o5WcS4AAAAASUVORK5CYII=' );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Phantom element template.
|
* Phantom element template.
|
||||||
|
@ -86,7 +83,6 @@ ve.ce.ProtectedNode.prototype.onProtectedLive = function () {
|
||||||
}
|
}
|
||||||
$shield = $shieldTemplate.clone().appendTo( $this );
|
$shield = $shieldTemplate.clone().appendTo( $this );
|
||||||
node.$shields = node.$shields.add( $shield );
|
node.$shields = node.$shields.add( $shield );
|
||||||
$this.append( $shieldTemplate.clone() );
|
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue