Skip to content

Commit

Permalink
refactor: remove unused color gutter flag
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Dec 2, 2024
1 parent 24bbeb9 commit ee6be10
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/extensionsIntegrated/CSSColorPreview/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ define(function (require, exports, module) {
* @param {Editor} editor the codemirror instance
* @param {Number} lineNumber the line number that is clicked
* @param {string} colorValue the color value clicked
* @param {boolean} dontEdit if set to true,color editor won't be opened
*/
function _colorIconClicked(editor, lineNumber, colorValue, dontEdit) {
function _colorIconClicked(editor, lineNumber, colorValue) {
const lineText = editor.getLine(lineNumber);
const colorIndex = lineText.indexOf(colorValue);
const currentPos = editor.getCursorPos(false, "start");
Expand All @@ -160,10 +159,6 @@ define(function (require, exports, module) {
editor.focus();
}

if(dontEdit){
return;
}

// Added a 50ms delay with setTimeout to make sure the quick edit menu toggles correctly.
// Without it, closing the menu trigger text selection, reopening the menu.
setTimeout(() => {
Expand Down Expand Up @@ -200,7 +195,7 @@ define(function (require, exports, module) {
$marker.click((event)=>{
event.preventDefault();
event.stopPropagation();
_colorIconClicked(editor, obj.lineNumber, obj.colorValues[0], false);
_colorIconClicked(editor, obj.lineNumber, obj.colorValues[0]);
});
} else {
// Multiple colors preview
Expand All @@ -225,7 +220,7 @@ define(function (require, exports, module) {
$colorBox.click((event)=>{
event.preventDefault();
event.stopPropagation();
_colorIconClicked(editor, obj.lineNumber, color, false);
_colorIconClicked(editor, obj.lineNumber, color);
});
$marker.append($colorBox);
}
Expand Down

0 comments on commit ee6be10

Please sign in to comment.