File tree Expand file tree Collapse file tree 3 files changed +170
-0
lines changed Expand file tree Collapse file tree 3 files changed +170
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copy all the navigational links into a single mobile menu
3
+ */
4
+ jQuery ( function ( ) {
5
+ var $mobilemenu = jQuery ( '<div>' )
6
+ . addClass ( 'mobile-menu' ) ;
7
+
8
+
9
+ var $logo = jQuery ( '#p-logo' )
10
+ . clone ( )
11
+ . removeAttr ( 'id' )
12
+ . addClass ( 'mobile-logo' )
13
+ ;
14
+
15
+ var $search = jQuery ( '#p-search form' )
16
+ . clone ( )
17
+ . removeAttr ( 'id' )
18
+ . addClass ( 'mobile-search' ) ;
19
+ $search . find ( '#simpleSearch' ) . removeAttr ( 'id' ) ;
20
+ $search . find ( 'button' ) . text ( '🔍' ) ;
21
+
22
+ $mobilemenu . append ( $search ) ;
23
+
24
+ jQuery ( [
25
+ 'p-navigation' ,
26
+ 'left-navigation' ,
27
+ 'right-navigation' ,
28
+ 'p-coll-print_export' ,
29
+ 'p-tb' ,
30
+ 'p-personal'
31
+ ] ) . each ( function ( i , name ) {
32
+ var ul = jQuery ( '<ul>' ) ;
33
+ $mobilemenu . append ( ul ) ;
34
+
35
+ var filter = '#' + name + ' li' ;
36
+ ul . addClass ( 'mobile-' + name ) ;
37
+ ul . append (
38
+ jQuery ( filter )
39
+ . not ( '.selected' )
40
+ . clone ( )
41
+ . removeAttr ( 'id' )
42
+ ) ;
43
+ } ) ;
44
+
45
+ var $hamburger = jQuery ( '<div>' )
46
+ . addClass ( 'mobile-hamburger' )
47
+ . click ( function ( ) {
48
+ $mobilemenu . toggleClass ( 'open' ) ;
49
+ $hamburger . toggleClass ( 'open' )
50
+ } ) ;
51
+
52
+
53
+ jQuery ( 'body' )
54
+ . append ( [
55
+ $mobilemenu ,
56
+ $hamburger
57
+ ] )
58
+ . prepend (
59
+ $logo
60
+ )
61
+ ;
62
+ } ) ;
Original file line number Diff line number Diff line change
1
+ div .mobile-hamburger ,
2
+ div .mobile-menu ,
3
+ div .mobile-logo {
4
+ display : none ;
5
+ }
6
+
7
+
8
+ @media only screen and (max-width : 750px ) {
9
+
10
+ div .mobile-hamburger {
11
+ display : block ;
12
+ position : absolute ;
13
+ top : 0 ;
14
+ left : 0 ;
15
+ z-index : 1000 ;
16
+
17
+ cursor : pointer ;
18
+ font-size : 2.5rem ;
19
+ line-height : 3rem ;
20
+
21
+ width : 3rem ;
22
+ height : 3rem ;
23
+ text-align : center ;
24
+
25
+ & ::before {
26
+ content : ' ☰' ;
27
+ }
28
+ }
29
+
30
+ div .mobile-hamburger.open {
31
+ & ::before {
32
+ content : ' ✕' ;
33
+ }
34
+ }
35
+
36
+ div .mobile-logo {
37
+ display : block ;
38
+ a {
39
+ display : block ;
40
+ width : 100% ;
41
+ height : 3rem ;
42
+ background-size : contain ;
43
+ background-repeat : no-repeat ;
44
+ background-position : center ;
45
+ }
46
+ }
47
+
48
+ div .mobile-menu {
49
+ position : absolute ;
50
+ top : 0 ;
51
+ left : 0 ;
52
+
53
+ height : 100% ;
54
+ overflow-y : auto ;
55
+
56
+ z-index : 500 ;
57
+ background-color : @ini_background ;
58
+ box-shadow : 5px 0 5px @ini_border ;
59
+
60
+ padding-top : 3rem ;
61
+
62
+ a {
63
+ color : @ini_existing ;
64
+ }
65
+
66
+ .mobile-search {
67
+ display : block ;
68
+ margin : 0.25em ;
69
+ input ,
70
+ button {
71
+ line-height : inherit ;
72
+ }
73
+ }
74
+
75
+ ul {
76
+ padding : 0 ;
77
+ list-style-type : none ;
78
+ list-style-image : none !important ;
79
+ margin : 0.25em 0 ;
80
+
81
+ border-bottom : 1px solid @ini_border ;
82
+
83
+ li {
84
+ margin : 0 ;
85
+ padding : 0.25em ;
86
+ }
87
+ }
88
+ }
89
+
90
+ div .mobile-menu.open {
91
+ display : block ;
92
+ }
93
+
94
+ #page-base ,
95
+ #head-base ,
96
+ #head ,
97
+ #panel {
98
+ display : none ;
99
+ }
100
+
101
+ div #content ,
102
+ div #footer {
103
+ margin-left : 0 ;
104
+ }
105
+
106
+ }
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ user/rtl.css = rtl
76
76
77
77
78
78
79
+ static/mobile.less = all
80
+
79
81
80
82
; This section is used to configure some placeholder values used in
81
83
; the stylesheets. Changing this file is the simplest method to
You can’t perform that action at this time.
0 commit comments