
(function () {

  var isShowAsGrid = function() {
    return window.localStorage && window.localStorage.SteemMoreInfoShowPostsAsGrid === 'yes' || false;
  };

  var setShowAsGrid = function(v) {
    if(window.localStorage){
      window.localStorage.SteemMoreInfoShowPostsAsGrid = v ? 'yes' : 'no';
    }
  };

  var createButton = function(grid){
    return '<div class="list-grid-toggle">\
      <div class="icon' + (grid ? ' icon-grid': '') + '">\
        <div class="icon-bar"></div>\
        <div class="icon-bar"></div>\
        <div class="icon-bar"></div>\
      </div>\
      <span class="label">List</span>\
    </div>';
  };

  var showAsGridButtons = $('<div class="smi-show-as-grid-buttons">\
    <a class="smi-show-as-grid-button" href="#">' + createButton(true) + '</a>\
    <a class="smi-show-as-list-button" href="#">' + createButton() + '</a>\
  </div>');

  showAsGridButtons.find('.smi-show-as-grid-button').on('click', function(e) {
    e.preventDefault();
    $('html').addClass('smi-show-posts-as-grid');
    setShowAsGrid(true);
  });
  showAsGridButtons.find('.smi-show-as-list-button').on('click', function(e) {
    e.preventDefault();
    $('html').removeClass('smi-show-posts-as-grid');
    setShowAsGrid(false);
  });


  $('.Header__sub-nav').append(showAsGridButtons);

  if(isShowAsGrid()) {
    $('html').addClass('smi-show-posts-as-grid');    
  }
  
})();

@@ -627,24 +627,73 @@
 iv%3E';%0A  %7D;%0A%0A
+  if(!$('.smi-show-as-grid-buttons').length)%7B%0A%0A  
   var showAs
@@ -745,24 +745,26 @@
 -buttons%22%3E%5C%0A
+  
     %3Ca class
@@ -831,16 +831,18 @@
  '%3C/a%3E%5C%0A
+  
     %3Ca c
@@ -909,16 +909,18 @@
  '%3C/a%3E%5C%0A
+  
   %3C/div%3E
@@ -924,16 +924,18 @@
 iv%3E');%0A%0A
+  
   showAs
@@ -1001,32 +1001,34 @@
 nction(e) %7B%0A    
+ 
+ 
 e.preventDefault
@@ -1023,32 +1023,34 @@
 eventDefault();%0A
+  
     $('html').ad
@@ -1075,32 +1075,34 @@
 osts-as-grid');%0A
+  
     setShowAsGri
@@ -1110,22 +1110,26 @@
 (true);%0A
+  
   %7D);%0A
+  
   showAs
@@ -1195,24 +1195,26 @@
 nction(e) %7B%0A
+  
     e.preven
@@ -1225,24 +1225,26 @@
 ault();%0A    
+  
 $('html').re
@@ -1280,24 +1280,26 @@
 grid');%0A    
+  
 setShowAsGri
@@ -1314,15 +1314,21 @@
 ;%0A  
+ 
+ 
 %7D);%0A%0A
-%0A
  
+   //
  $('
@@ -1373,16 +1373,270 @@
 ttons);%0A
+    var container = $('.Header__top .Header__top-steemit').parent().find('.HorizontalMenu');%0A    container.append('%3Cli class=%22delim show-for-medium%22 style=%22padding-left: 5px; padding-right: 10px;%22%3E%7C%3C/li%3E');%0A    container.append(showAsGridButtons);%0A%0A  %7D%0A%0A
 %0A  if(is

Fix show as grid buttons