forked from FrontendMatter/bootstrap-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.browserify.js
More file actions
41 lines (31 loc) · 972 Bytes
/
Copy pathapp.browserify.js
File metadata and controls
41 lines (31 loc) · 972 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
37
38
39
40
41
// Vendor libraries
// jQuery
window.$ = window.jQuery = require('jquery')
// Tether (required by Bootstrap 4)
window.Tether = require('tether')
// Bootstrap 4
require('bootstrap')
// Simplebar
require('simplebar/dist/simplebar.min')
// Bootstrap Layout
require('bootstrap-layout')
// Bootstrap Layout Scrollable
require('bootstrap-layout-scrollable')
// Anchor.js
var AnchorJS = require('anchor-js');
var anchorsAlways = new AnchorJS({ visible: 'always' })
anchorsAlways.add('.layout-content h2')
var anchorsHover = new AnchorJS({ visible: 'hover' })
anchorsHover.add('.layout-content h3')
// show active tab on reload
if (location.hash !== '') {
$('[data-toggle="pill"][href="' + location.hash + '"]').tab('show')
}
// remember the hash in the URL without jumping
$('[data-toggle="pill"]').on('shown.bs.tab', function (e) {
var hash = $(e.target).attr('href')
if (history.pushState) {
return history.pushState(null, null, hash)
}
location.hash = hash
})