-
Notifications
You must be signed in to change notification settings - Fork 3
fix : 문제 이미지 누락된 코드 수정 #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -295,7 +295,7 @@ | |||||||||||||||||||||||||||||
| /* 비활성 상태의 밑줄 */ | ||||||||||||||||||||||||||||||
| color: #ccc; | ||||||||||||||||||||||||||||||
| /* 기본 글자색 */ | ||||||||||||||||||||||||||||||
| font-size: 20px; | ||||||||||||||||||||||||||||||
| font-size: 20px; | ||||||||||||||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||||||||||||||
| transition: all 0.2s ease-in-out; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
@@ -816,6 +816,10 @@ | |||||||||||||||||||||||||||||
| <div id="discussion-pagination"></div> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <div id="prob-image-wrapper"> | ||||||||||||||||||||||||||||||
| <img id="prob-image" src="" alt="문제 이미지" style="max-width: 100%; height: auto;" /> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
| <div class="right"> | ||||||||||||||||||||||||||||||
| <div class="section"> | ||||||||||||||||||||||||||||||
|
|
@@ -932,6 +936,13 @@ <h3>채점 결과</h3> | |||||||||||||||||||||||||||||
| probTimeEl.textContent = data.timeLimit ?? '--'; | ||||||||||||||||||||||||||||||
| probMemEl.textContent = data.memoryLimit ?? '--'; | ||||||||||||||||||||||||||||||
| probCatsEl.textContent = Array.isArray(data.categories) ? data.categories.join(', ') : ''; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if (data.imageUrl) { | ||||||||||||||||||||||||||||||
| probImageEl.src = data.imageUrl; | ||||||||||||||||||||||||||||||
| probImageEl.style.display = 'block'; | ||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||
| probImageEl.style.display = 'none'; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+940
to
+945
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 이미지 표시/숨김 로직 보완 제안
-if (data.imageUrl) {
- probImageEl.src = data.imageUrl;
- probImageEl.style.display = 'block';
-} else {
- probImageEl.style.display = 'none';
-}
+if (data.imageUrl) {
+ probImageEl.src = data.imageUrl;
+ probImageEl.alt = `${data.title} 이미지`;
+ probImageEl.parentElement.style.display = 'block';
+} else {
+ probImageEl.removeAttribute('src');
+ probImageEl.parentElement.style.display = 'none';
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||||||
| console.error(err); | ||||||||||||||||||||||||||||||
| probTitleEl.textContent = '네트워크 오류'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문제 이미지가 토글 탭 외부에 위치하여 항상 표시되는 문제
prob-image-wrapper가description-contentdiv 밖에 배치되어 있어, 사용자가토론글탭으로 전환해도 이미지가 계속 노출됩니다. 의도대로라면 문제 설명과 함께 숨겨져야 합니다.이렇게 옮기면 탭 전환 로직(
.left-content.active)에 따라 이미지도 자연스럽게 토글됩니다.추가로
display:none을 초기값으로 주어 첫 로드 시 깜빡임을 방지할 수 있습니다.🤖 Prompt for AI Agents