백기선 2015-04-28
Merge branch 'issue/reviewlist-default-setting' into 'next'
from pull-request 1569

* refs/heads/issue/reviewlist-default-setting:
  Pullrequest: Change to visibility default setting of review list

Reviewed-by: 백기선 
Reviewed-by: 채수원 
@950fecb797f50aa1a7b4e286512f79e0e41f1af8
app/views/git/viewChanges.scala.html
--- app/views/git/viewChanges.scala.html
+++ app/views/git/viewChanges.scala.html
@@ -47,11 +47,12 @@
                 </div>
             </div>
 
-            <div class="codediff-wrap mt10 @if(requestHeader.cookies.get("diffs-only") != null){diffs-only}">
-                <button type="button" class="ybtn ybtn-default btn-show-reviewcards">
+            <div class="codediff-wrap mt10 @if(pull.commentThreads.size == 0) {diffs-only}">
+              @if(pull.commentThreads.size > 0) {
+              <button type="button" class="ybtn ybtn-default btn-show-reviewcards">
                     <i class="yobicon-restore"></i>
                 </button>
-
+                }
                 <div id="changes" class="diffs-wrap">
                     <div id="commits" class="btn-group auto mb10">
                         <button class="btn dropdown-toggle auto" data-toggle="dropdown">
@@ -150,7 +151,7 @@
                     }
                     @** // BlockComment **@
                 </div>
-
+                @if(pull.commentThreads.size > 0) {
                 <div class="review-wrap">
                     <div class="review-container">
                         <button type="button" class="ybtn ybtn-default btn-hide-reviewcards">
@@ -171,8 +172,10 @@
                                 @partial_reviewlist(pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED))
                             </div>
                         </div>
+
                     </div>
                 </div>
+                }
             </div>
         </div>
     </div>
public/javascripts/service/yobi.code.Diff.js
--- public/javascripts/service/yobi.code.Diff.js
+++ public/javascripts/service/yobi.code.Diff.js
@@ -111,12 +111,6 @@
             htElement.waBtnToggleReviewWrap.on("click", function(){
                 htElement.welContainer.toggleClass("diffs-only");
 
-                if (htElement.welContainer.hasClass("diffs-only")) {
-                    $.cookie("diffs-only", true, {"expire": 365});
-                } else {
-                    $.removeCookie("diffs-only");
-                }
-
                 var positionTop =  10;
                 if(htElement.welReviewContainer.offset().top - positionTop < $(document).scrollTop()){
                     htElement.welReviewContainer
Add a comment
List