fix(editor): sync rich text color toolbar state#382
Conversation
There was a problem hiding this comment.
Sorry @dengzhongyuan365-dev, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Note
详情{
"src/web/js/summernote_v9_2.js": [
{
"line": " var KEY_BOGUS = 'bogus';",
"line_number": 3933,
"rule": "S106",
"reason": "Var naming | 6d7db7168d"
},
{
"line": " .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')",
"line_number": 6927,
"rule": "S35",
"reason": "Url link | dcb31e9ddf"
},
{
"line": " .attr('src', 'http://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');",
"line_number": 6964,
"rule": "S35",
"reason": "Url link | ce631f8419"
}
]
} |
Update the rich text toolbar color buttons from the current selection style. 选中已有文字时,根据当前选区样式同步字体颜色和高亮色按钮状态。 Read foreground and background colors from current editor style. 从当前编辑器样式中读取前景色和背景色。 Keep color icon display and palette selected state consistent with selected text. 保持颜色图标显示和调色板选中态与选中文字一致。 Log: 修复富文本工具栏颜色与编辑区选中文字颜色显示不一致 PMS: BUG-277431 Influence: 选中已有文字或高亮文字时,工具栏中的字体颜色和高亮色显示更准确;设置颜色和后续输入逻辑不受影响。
7631825 to
6f8868d
Compare
|
Note
详情{
"src/web/js/summernote_v9_2.js": [
{
"line": " var KEY_BOGUS = 'bogus';",
"line_number": 3933,
"rule": "S106",
"reason": "Var naming | 6d7db7168d"
},
{
"line": " .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')",
"line_number": 6928,
"rule": "S35",
"reason": "Url link | dcb31e9ddf"
},
{
"line": " .attr('src', 'http://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');",
"line_number": 6965,
"rule": "S35",
"reason": "Url link | ce631f8419"
}
]
} |
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 Buttons.prototype.updateCurrentColorButton = function ($container, groupSelector, eventName, color) {
var _this = this;
var normalizedColor = this.normalizeColor(color);
var $group = $container.find(groupSelector);
if (!$group.length) {
return;
}
var $matchedButton = $$1();
var $colorBtns = $group.find('.note-color-btn');
$colorBtns.each(function (idx, item) {
var $item = $$1(item);
if (_this.normalizeColor($item.attr('data-value')) === normalizedColor) {
$matchedButton = $item;
return false;
}
});
$colorBtns.removeClass('selectColor');
if ($matchedButton.length) {
$matchedButton.addClass('selectColor');
}
var $currentButton = $group.find('.note-current-color-button');
if (normalizedColor && normalizedColor !== 'transparent') {
$currentButton.attr('data-' + eventName, normalizedColor);
if (eventName === 'foreColor') {
$group.find('.icon-forecolor .path1').css('color', normalizedColor);
} else if (eventName === 'backColor') {
$group.find('.icon-backcolor .path1').css('color', normalizedColor);
}
} else {
$currentButton.removeAttr('data-' + eventName);
if (eventName === 'foreColor') {
$group.find('.icon-forecolor .path1').css('color', '');
} else if (eventName === 'backColor') {
$group.find('.icon-backcolor .path1').css('color', '');
}
}
}; |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
Update the rich text toolbar color buttons from the current selection style.
选中已有文字时,根据当前选区样式同步字体颜色和高亮色按钮状态。
Read foreground and background colors from current editor style.
从当前编辑器样式中读取前景色和背景色。
Keep color icon display and palette selected state consistent with selected text.
保持颜色图标显示和调色板选中态与选中文字一致。
Log: 修复富文本工具栏颜色与编辑区选中文字颜色显示不一致
PMS: BUG-277431
Influence: 选中已有文字或高亮文字时,工具栏中的字体颜色和高亮色显示更准确;设置颜色和后续输入逻辑不受影响。