Hyeonjae Park 2019-01-08
Merge branch 'feature/sidebar-button' into next
Reviewed-by: Suwon Chae
@ebb2a7062749f3da9640546cdf7b15669b0f88f1
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -133,6 +133,10 @@
         padding: 6px 2px;
     }
 
+    .yobicon-arrow-left {
+        padding: 6px 2px;
+    }
+
     &:hover {
         cursor: pointer;
         color: white;
app/views/layout.scala.html
--- app/views/layout.scala.html
+++ app/views/layout.scala.html
@@ -100,13 +100,20 @@
                     window.location.href = "@routes.Application.index?path=" + window.location.pathname;
                 } else {
                     window.parent.$(".sidebar").toggle();
+                    var btn = $("div.pin > i.yobicon-arrow-right").removeClass("yobicon-arrow-right").addClass("yobicon-arrow-left");
+                    if (btn.length < 1) {
+                        $("div.pin > i.yobicon-arrow-left").removeClass("yobicon-arrow-left").addClass("yobicon-arrow-right");
+                    }
                     if(window.parent.$(".sidebar").text().trim().length < 1) {
                         window.parent.location.reload();
                     }
                 }
             });
-        })
 
+            if ($("div#sidebar.sidebar", window.parent.document).css("display") === "block") {
+                $("div.pin > i.yobicon-arrow-right").removeClass("yobicon-arrow-right").addClass("yobicon-arrow-left");
+            }
+        });
     </script>
 
     @if(Application.SEND_YONA_USAGE){
public/javascripts/common/yona.Usermenu.js
--- public/javascripts/common/yona.Usermenu.js
+++ public/javascripts/common/yona.Usermenu.js
@@ -28,22 +28,12 @@
             }
         });
 
-        $("#sidebar-open-btn").on("click", function (event) {
-            event.stopPropagation();
-            if( $sidebar.width() !== 0){
-                closeSidebar($sidebar);
-            } else {
-                openSidebar($sidebar);
-                updateStar();
-            }
-        });
-
         function closeSidebar($sidebar) {
             $sidebar.width("0").css("border", "none");
             $(".main-stream").removeClass("span8").addClass("span12");
         }
 
-        function openSidebar($sidebar){
+        function openSidebar($sidebar) {
             // 720px is a criteria to distinguish small devices
             if (viewSize > PIXEL_CRITERIA_FOR_SMALL_DEVICE) {
                 $sidebar.width(SIDE_BAR_DEFAULT_WIDTH).css("border", "1px solid #ccc");
public/stylesheets/yobicon/style.css
--- public/stylesheets/yobicon/style.css
+++ public/stylesheets/yobicon/style.css
@@ -180,10 +180,10 @@
     content: "\e02f";
 }
 .yobicon-arrow-left:before {
-    content: "\e030";
+    content: "\e031";
 }
 .yobicon-arrow-right:before {
-    content: "\e031";
+    content: "\e030";
 }
 .yobicon-arrow-up:before {
     content: "\e032";
Add a comment
List