[Notice] Announcing the End of Demo Server [Read me]
doortts doortts 2018-12-11
sidebar: Add complementary fixes
- Add pinning feature
- Modify layout for small screen size
- Update parent title when to click the link in iframe
- Update url path of browser when to click the link in iframe
- Bug fix when to access by direct url
- Bug fix of scroll postion of iframe
@087390108b6b5676b71535e1bc77a80ecfd0e88f
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -47,7 +47,16 @@
 
     .user-menu-wrap {
         padding: 10px;
+        color: grey;
+        box-sizing: border-box;
+
+        a {
+            &:hover {
+                color: white;
+            }
+        }
     }
+
     .user-menu {
         padding: 5px;
     }
@@ -112,10 +121,19 @@
     }
 }
 
+.pin {
+    position: fixed;
+    display: inline-block;
+    left: -2px;
+    top: 9px;
+    border: 1px solid #666;
+}
+
 .gnb-inner {
     margin:0 auto;
     color:#788ba7;
     height:40px;
+    width: 99%;
 }
 
 .gnb-inner {
@@ -407,6 +425,7 @@
         .project-header-wrap {
             height:inherit;
             margin:0 auto;
+            width: 99%;
             position: relative;
 
             .project-header-avatar {
app/assets/stylesheets/less/_responsive.less
--- app/assets/stylesheets/less/_responsive.less
+++ app/assets/stylesheets/less/_responsive.less
@@ -1,6 +1,10 @@
 @media all and (max-width: 720px){
     body {
         overflow-y: auto;
+        flex-direction: column;
+    }
+    .sidebar {
+        position: relative;
     }
     .sidemenu-width {
       width: 100vw !important;
app/assets/stylesheets/less/_usermenu.less
--- app/assets/stylesheets/less/_usermenu.less
+++ app/assets/stylesheets/less/_usermenu.less
@@ -98,6 +98,14 @@
     .popover {
       word-wrap: break-word;
       min-width: 200px;
+      background-color: black;
+      color: white;
+
+      .arrow {
+        &::after {
+          border-right-color: black;
+        }
+      }
     }
 
   }
@@ -227,7 +235,6 @@
   ::-webkit-scrollbar-thumb {
     background: #1fb0ff;
   }
-
 
   li:focus {
     outline:solid 0 #DCDCDC;
app/views/common/navbar.scala.html
--- app/views/common/navbar.scala.html
+++ app/views/common/navbar.scala.html
@@ -36,9 +36,10 @@
 </div>
 <header class="gnb-outer @if(project != null || org != null) {project-header}">
     <div class="gnb-inner">
+        <div class="pin"><i class="yobicon-arrow-right"></i></div>
         <ul class="gnb-nav">
             <li>
-                <a href="@routes.Application.index()" class="logo logo-letter">Y</a>
+                <a href="@routes.Application.index()" target="_parent" class="logo logo-letter">Y</a>
             </li>
             @if(!Application.HIDE_PROJECT_LISTING && !UserApp.currentUser().isGuest){
                 <li class="@isActiveMenu(MenuType.PROJECTS)">
app/views/index/index.scala.html
--- app/views/index/index.scala.html
+++ app/views/index/index.scala.html
@@ -10,4 +10,6 @@
 @import utils.JodaDateUtil
 @import utils.MenuType._
 
-@views.html.index.notifications(currentUser)
+@siteLayout_framed(utils.Config.getSiteName, utils.MenuType.SITE_HOME) {
+
+}
app/views/index/notifications.scala.html
--- app/views/index/notifications.scala.html
+++ app/views/index/notifications.scala.html
@@ -10,7 +10,7 @@
 @import utils.JodaDateUtil
 @import utils.MenuType._
 
-@siteLayout_framed(utils.Config.getSiteName, utils.MenuType.SITE_HOME) {
+@siteLayout(utils.Config.getSiteName, utils.MenuType.SITE_HOME) {
     @if(currentUser == User.anonymous){
     @partial_intro()
     } else {
app/views/layout.scala.html
--- app/views/layout.scala.html
+++ app/views/layout.scala.html
@@ -91,7 +91,19 @@
                     }
                 });
             });
+
+            window.parent.document.title = window.document.title;
+            window.parent.history.pushState('', window.document.title, window.location.href);
+
+            $(".pin").on("click", function () {
+                if (window.parent === window) {
+                    window.location.href = "@routes.Application.index?path=" + window.location.pathname;
+                } else {
+                    window.parent.$(".sidebar").toggle();
+                }
+            });
         })
+
     </script>
 
     @if(Application.SEND_YONA_USAGE){
app/views/layout_framed.scala.html
--- app/views/layout_framed.scala.html
+++ app/views/layout_framed.scala.html
@@ -4,11 +4,14 @@
 * Copyright Yona & Yobi Authors & NAVER Corp.
 * https://yona.io
 **@
-@(title: String)(theme:String)(content: Html)
+@(title: String)(theme:String)(content: Html)(implicit request: RequestHeader)
 @titleArray = @{title.split(" \\|:\\| ")}
 @currentUser = @{
     UserApp.currentUser()
 }
+    @iframePath = @{
+        request.getQueryString("path").getOrElse(UserSetting.findByUser(currentUser.id).loginDefaultPage)
+    }
 
 <!DOCTYPE html>
 <html lang="@UserApp.currentUser().getPreferredLanguage">
@@ -44,17 +47,20 @@
     @sidebar()
     </div>
     <div id="mainFrame">
-        <iframe name="mainFrame" frameborder="0" scrolling="no" height="100%" width="100%" src="/user/issues"  scrolling="no" onload="resizeIframe(this)"></iframe>
+        <iframe name="mainFrame" frameborder="0" scrolling="no" height="100%" width="100%" src="@iframePath"  scrolling="no" onload="resizeIframe(this)"></iframe>
         @common.scripts()
     </div>
 
     <script type="text/javascript">
         $(function() {
             NProgress.configure({minimum: 0.7});
+
+            $('[data-toggle="popover"]').popover();
         });
 
         function resizeIframe(obj) {
             obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
+            window.scrollTo(0, 0);
         }
 
         //Following three values are used for common/yona.Usermenu.js
@@ -65,9 +71,6 @@
         var UsermenuGetFoveriteIssuesUrl = "@api.routes.UserApi.getFoveriteIssues()";
         var UsermenuUrl = "@routes.UserApp.usermenuTabContentList()";
 
-        $(function () {
-            $('[data-toggle="popover"]').popover();
-        })
     </script>
     <script type="text/javascript" src="@routes.Assets.at("javascripts/common/yona.Usermenu.js")"></script>
 
Add a comment
List