Bug #22437 ยป rtehtmlarea_bugfix_14085.patch
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js (copie de travail) | ||
---|---|---|
setColor: function(button, event) {
|
||
this.restoreSelection();
|
||
var buttonId = this.dialog.arguments.buttonId;
|
||
var color = '#' + this.dialog.find('itemId', 'color')[0].getValue();
|
||
var color = this.dialog.find('itemId', 'color')[0].getValue();
|
||
if (color) {
|
||
color = '#' + color;
|
||
}
|
||
this.editor.focus();
|
||
var element,
|
||
fullNodeSelected = false;
|
||
... | ... | |
if ((element.nodeName.toLowerCase() === 'span') && !HTMLArea.hasAllowedAttributes(element, this.allowedAttributes)) {
|
||
this.editor.removeMarkup(element);
|
||
}
|
||
} else if (this.editor.endPointsInSameBlock()) {
|
||
} else if (color && this.editor.endPointsInSameBlock()) {
|
||
var element = this.editor._doc.createElement('span');
|
||
// Set the color in the style attribute
|
||
element.style[this.styleProperty[buttonId]] = color;
|
||
this.editor.wrapWithInlineElement(element, selection, range);
|
||
if (!Ext.isIE) {
|
||
range.detach();
|
||
}
|
||
}
|
||
if (!Ext.isIE) {
|
||
range.detach();
|
||
}
|
||
this.close();
|
||
event.stopEvent();
|
||
},
|