@itcenter-layout/masterpage
Advanced tools
Comparing version 0.5.0 to 0.5.1
/*! | ||
Itcenter masterpage v0.5.0 | ||
Itcenter masterpage v0.5.1 | ||
*/ | ||
@@ -11,3 +11,5 @@ document.addEventListener('DOMContentLoaded', (event) => { | ||
var searchButtonOpen = document.getElementById("search-button-open"); | ||
var main = document.getElementById("main"); | ||
var backupMain = main.innerHTML; | ||
if (cancelSearch) { | ||
@@ -27,6 +29,2 @@ cancelSearch.addEventListener("click", function (e) { | ||
/*$('.search-button').on('click', function () { | ||
rwthapp.search.search($('.search-input').val()); | ||
});*/ | ||
if (inputField) { | ||
@@ -49,5 +47,25 @@ inputField.addEventListener("keypress", function (e) { | ||
} | ||
searchMain(); | ||
inputField.focus(); | ||
}); | ||
} | ||
function searchMain(text) { | ||
if (window.find && window.getSelection) { | ||
document.designMode = "on"; | ||
main.innerHTML = backupMain; | ||
var sel = window.getSelection(); | ||
sel.collapse(main, 0); | ||
var text = inputField.value; | ||
while (window.find(text)) { | ||
if(main.contains(sel.getRangeAt(0).startContainer)) { | ||
document.execCommand("HiliteColor", false, "yellow"); | ||
sel.collapseToEnd(); | ||
} | ||
} | ||
document.designMode = "off"; | ||
} | ||
} | ||
if (cancelSearch) { | ||
@@ -58,2 +76,3 @@ cancelSearch.addEventListener("click", function (e) { | ||
cancelSearch.style.display = "none"; | ||
main.innerHTML = backupMain; | ||
return false; | ||
@@ -68,2 +87,3 @@ }); | ||
inputField.value = ""; | ||
main.innerHTML = backupMain; | ||
}); | ||
@@ -124,6 +144,6 @@ } | ||
e.preventDefault(); | ||
if(!body.classList.contains("show-drawer")) { | ||
body.classList.add("show-drawer"); | ||
if(!body.classList.contains("show-menu")) { | ||
body.classList.add("show-menu"); | ||
} else { | ||
body.classList.remove("show-drawer"); | ||
body.classList.remove("show-menu"); | ||
} | ||
@@ -137,4 +157,4 @@ }); | ||
e.preventDefault(); | ||
if(body.classList.contains("show-drawer")) { | ||
body.classList.remove("show-drawer"); | ||
if(body.classList.contains("show-menu")) { | ||
body.classList.remove("show-menu"); | ||
} | ||
@@ -159,7 +179,7 @@ }); | ||
if(navWidth <= 767) { | ||
body.classList.remove("show-drawer"); | ||
body.classList.remove("show-menu"); | ||
} else { | ||
body.classList.add("show-drawer"); | ||
body.classList.add("show-menu"); | ||
} | ||
} | ||
}); |
{ | ||
"name": "@itcenter-layout/masterpage", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "masterpage", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45002
1137