-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathscripts.js
More file actions
36 lines (32 loc) · 958 Bytes
/
scripts.js
File metadata and controls
36 lines (32 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$(function () {
$('#side-menu').metisMenu()
})
$(function () {
$(window).bind('load resize', function () {
var topOffset = 50
var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width
if (width < 768) {
$('div.navbar-collapse').addClass('collapse')
topOffset = 100 // 2-row-menu
} else {
$('div.navbar-collapse').removeClass('collapse')
}
var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1
height = height - topOffset
if (height < 1) height = 1
if (height > topOffset) {
$('#page-wrapper').css('min-height', (height) + 'px')
}
})
var url = window.location
var element = $('ul.nav a').filter(function () {
return this.href === url
}).addClass('active').parent()
while (true) {
if (element.is('li')) {
element = element.parent().addClass('in').parent()
} else {
break
}
}
})