-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5e058f
commit a0b723c
Showing
1 changed file
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
var domReady = function(callback) { | ||
var state = document.readyState ; | ||
if ( state === 'interactive' || state === 'complete' ) { | ||
callback() ; | ||
} | ||
else { | ||
const domReady = function (callback) { | ||
const state = document.readyState; | ||
if (state === 'interactive' || state === 'complete') { | ||
callback(); | ||
} else { | ||
document.addEventListener('DOMContentLoaded', callback); | ||
} | ||
} ; | ||
|
||
}; | ||
|
||
domReady(function(){ | ||
|
||
var projectname = document.createElement('a'); | ||
domReady(function () { | ||
const projectname = document.createElement('a'); | ||
projectname.classList.add('project-name'); | ||
projectname.text = 'aureooms/js-knapsack'; | ||
projectname.href = './index.html' ; | ||
projectname.href = './index.html'; | ||
|
||
var header = document.getElementsByTagName('header')[0] ; | ||
header.insertBefore(projectname,header.firstChild); | ||
const header = document.querySelectorAll('header')[0]; | ||
header.insertBefore(projectname, header.firstChild); | ||
|
||
var testlink = document.querySelector('header > a[data-ice="testLink"]') ; | ||
testlink.href = 'https://coveralls.io/github/aureooms/js-knapsack' ; | ||
testlink.target = '_BLANK' ; | ||
const testlink = document.querySelector('header > a[data-ice="testLink"]'); | ||
testlink.href = 'https://coveralls.io/github/aureooms/js-knapsack'; | ||
testlink.target = '_BLANK'; | ||
|
||
var searchBox = document.querySelector('.search-box'); | ||
var input = document.querySelector('.search-input'); | ||
const searchBox = document.querySelector('.search-box'); | ||
const input = document.querySelector('.search-input'); | ||
|
||
// active search box when focus on searchBox. | ||
input.addEventListener('focus', function(){ | ||
// Active search box when focus on searchBox. | ||
input.addEventListener('focus', function () { | ||
searchBox.classList.add('active'); | ||
}); | ||
|
||
}); |