Gayeon Park 3 lat temu
rodzic
commit
7d34fce178

+ 1 - 1
realworld/src/main/resources/mybatis/mapper/user/ArticleMapper.xml

@@ -88,7 +88,7 @@
         ]]>
       </if>
       <![CDATA[
-        ORDER BY create_datetime DESC
+        ORDER BY AR.create_datetime DESC
         LIMIT 4
       ]]>
     </select>

+ 1 - 1
realworld/src/main/webapp/WEB-INF/jsp/article/articleDetails.jsp

@@ -189,7 +189,7 @@
                     const divComment = domParser.parseFromString(domStrComment, 'text/html').body.firstChild;
                     divComment.querySelector('.date-posted').textContent = new Date(comment.created).toLocaleString();
                     container.appendChild(divComment);
-                    const icons = document.querySelectorAll('.fa-trash-alt');
+                    const icons = document.querySelectorAll('.comment-footer .fa-trash-alt');
                     icons.forEach(icon => {
                         if (comment.userId == "${ssId}") {
                             icon.style.display = 'block';

+ 4 - 4
realworld/src/main/webapp/WEB-INF/jsp/main.jsp

@@ -119,7 +119,8 @@
                 username = "${ssUsername}";
 
                 loadArticle(articles);
-                nextPageLoad(articles, paging);
+                document.addEventListener("scroll", nextPageLoad(articles, paging));
+                // nextPageLoad(articles, paging);
             });
 
         filterArticle({ 'clickedFeed': unFocusedFeed.id })
@@ -237,7 +238,7 @@
             const divArticleMeta = domParser.parseFromString(domStrArticleMeta, 'text/html').body.firstChild;
             divArticleMeta.querySelector('.name').textContent = article.writerName;
             divArticleMeta.querySelector('.date').textContent = new Date(article.created).toLocaleString();
-            console.log(article.favorite)
+            
             if(article.favorite) {
                 divArticleMeta.querySelector('.favorite-btn').classList.add('active');
             }
@@ -347,9 +348,8 @@
                     .then(json => {
                         const { articles, paging } = json;
                         username = "${ssUsername}";
-                        loadArticle(articles);
-                        // articleList.removeChild(moreButton);
                         articleList.removeChild(loading);
+                        loadArticle(articles);
                         nextPageLoad(articles, paging);
                         
                     })

+ 8 - 7
realworld/src/main/webapp/resources/css/style.css

@@ -388,14 +388,15 @@ img {
     float: right;
     margin-top: 0.6rem;
     margin-bottom: 1.2rem;
-    border: 1px solid #818a92;
-    padding: 0.25rem 0.5rem;
-    border-radius: 3px;
+    border-bottom: 1px solid #818a92;
+    padding: 0.1rem 0;
+    font-size: 1.2rem;
+    font-weight: 600;
 }
 
-.home-page #article-list .more-button:hover {
+/* .home-page #article-list .more-button:hover {
     background-color: #dddddd;
-}
+} */
 
 #loading {
     display: inline-block;
@@ -851,7 +852,7 @@ hr {
 .modal-message {
     padding-bottom: 40px;
     font-size: 2rem;
-    font-family: 'Nanum Gothic', sans-serif;
+    font-family: 'Noto Sans KR', sans-serif;
     color: var(--green-color);
 }
 
@@ -860,7 +861,7 @@ hr {
     background-color: var(--green-color);
     color: var(--white-color);
     font-weight: 700;
-    font-family: 'Nanum Gothic', sans-serif;
+    font-family: 'Noto Sans KR', sans-serif;
     width: 5rem;
     height: 2rem;
     border-radius: 0.3rem;