Browse code

Fix ios bug with speed access

Bruno Spyckerelle authored on 26/09/2016 14:36:23
Showing 3 changed files
... ...
@@ -213,7 +213,7 @@ body {
213 213
     padding-left: 0px;
214 214
     z-index: 2000;
215 215
     text-indent: 0px;
216
-    line-height: 20px;
216
+    line-height: 30px;
217 217
 }
218 218
 
219 219
 #wrapper.toggled #tabs-boards.speedaccess a:hover {
... ...
@@ -223,7 +223,7 @@ body {
223 223
 
224 224
 #wrapper.toggled #tabs-boards.speedaccess li {
225 225
     display: inline;
226
-    line-height: 20px;
226
+    line-height: 30px;
227 227
     text-indent: 2px;
228 228
     float: right;
229 229
 }
... ...
@@ -233,6 +233,7 @@ body {
233 233
     font-weight: 600;
234 234
     font-size: small;
235 235
     color: #333333;
236
+	cursor: pointer;
236 237
 }
237 238
 
238 239
 
... ...
@@ -29,7 +29,7 @@
29 29
             <li class="margintop8">
30 30
                 <a href="#" data-toggle="modal" data-target="#confModal">Configuration</a>
31 31
             </li>
32
-            <li>
32
+            <li id="sidebar-tribunes">
33 33
                 <a id="addTribune" href="#" data-toggle="modal" data-target="#confTribuneModal">Tribunes <span class="glyphicon glyphicon-plus"></span></a>
34 34
                 <ul id="tabs-boards">
35 35
 
... ...
@@ -485,10 +485,6 @@
485 485
         $("#wrapper").toggleClass("toggled");
486 486
         $("#menu-toggle").toggleClass("is-active");
487 487
     });
488
-    // close sidebar by default if smartphone
489
-    if($(window).width() <=768) {
490
-        $("#menu-toggle").trigger('click');
491
-    }
492 488
 </script>
493 489
 </body>
494 490
 </html>
495 491
\ No newline at end of file
... ...
@@ -816,8 +816,21 @@ $(document).ready(function(){
816 816
 
817 817
     if(settings.value('speedaccess') == true) {
818 818
         $("#tabs-boards").addClass('speedaccess');
819
+		//ios fix... 
820
+		$("#menu-toggle").on('click', function(e) {
821
+			if($("#wrapper").hasClass('toggled')){
822
+				$("#tabs-boards").detach().appendTo('#pinnipede');
823
+			} else {
824
+				$("#tabs-boards").detach().appendTo('#sidebar-tribunes');
825
+			}
826
+		});
819 827
     }
820
-
828
+	
829
+    // close sidebar by default if smartphone
830
+    if($(window).width() <=768) {
831
+        $("#menu-toggle").trigger('click');
832
+    }
833
+	
821 834
     if(settings.value('autocomplete') == false) {
822 835
         $("#message").attr('autocomplete', 'off');
823 836
     }
... ...
@@ -911,14 +924,39 @@ $(document).ready(function(){
911 924
     mc.on('doubletap', function(ev) {
912 925
         if(ev.pointerType == 'touch') {
913 926
             $(ev.target).closest('.post-container').find('.clock').trigger('click');
927
+			
928
+			var target = $(ev.target);
929
+            if (target.closest('li').hasClass('tab')) {
930
+                var boardName = target.closest('li').attr('id').substr(4);
931
+                for (var name in GlobalBoards) {
932
+                    var board = GlobalBoards[name];
933
+                    if (board.state != STATE_LOADED) {
934
+                        if (name == boardName) {
935
+                            GlobalBoardTabs[name].display();
936
+                            setPalmiTrib(name);
937
+                        }
938
+                        else {
939
+                            GlobalBoardTabs[name].hide();
940
+                        }
941
+                    }
942
+                }
943
+				toPinniBottom();
944
+            }
945
+            
914 946
         }
915 947
     });
916 948
 
917 949
     mc.on('singletap', function(ev) {
918 950
         if(ev.pointerType == 'touch') {
919 951
             var target = $(ev.target);
920
-            if (target.is('a') || target.hasClass('clock clockref ua login')) {
921
-                target[0].click();
952
+            if (target.is('a') || target.hasClass('clock clockref ua login tab')) {
953
+				if (target.closest('li').hasClass('tab')) {
954
+					var boardName = target.closest('li').attr('id').substr(4);
955
+					GlobalBoardTabs[boardName].toggle();
956
+					toPinniBottom();
957
+				} else {
958
+					target[0].click();
959
+				}
922 960
             } else if (!target.hasClass('clockref')) {//évite la double sélection
923 961
                 var parent = target.closest('.post-container');
924 962
                 hilightPost(parent.attr('id'), parent[0]);