Skip to content

Commit 05b31cb

Browse files
authored
Merge pull request #221 from WebCoder49/plugin-dialog-error-styles
Fix FindAndReplace and GoToLine plugins' error styles
2 parents 877e596 + b4dca53 commit 05b31cb

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

plugins/find-and-replace.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
}
6161

6262
.code-input_find-and-replace_dialog input.code-input_find-and-replace_error {
63-
color: #ff0000aa;
63+
color: #b60000;
6464
}
6565

6666
.code-input_find-and-replace_dialog button, .code-input_find-and-replace_dialog input[type="checkbox"] {

plugins/find-and-replace.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ codeInput.plugins.FindAndReplace = class extends codeInput.Plugin {
123123
// No matches - error
124124
dialog.findInput.classList.add('code-input_find-and-replace_error');
125125
}
126+
} else {
127+
// Input box is empty - no error
128+
dialog.findInput.classList.remove('code-input_find-and-replace_error');
126129
}
127130
this.updateMatchDescription(dialog);
128131
}

plugins/go-to-line.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545
.code-input_go-to-line_dialog input.code-input_go-to-line_error {
46-
color: #ff0000aa;
46+
color: #b60000;
4747
}
4848

4949
/* Cancel icon */

plugins/go-to-line.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {
8181
}
8282
}
8383
} else {
84-
// No value
84+
// No value, so no message or error
8585
dialog.guidance.textContent = "";
86+
dialog.input.classList.remove('code-input_go-to-line_error');
8687
}
8788

8889
if (event.key == 'Enter') {

0 commit comments

Comments
 (0)