Lijy 6 tháng trước cách đây
mục cha
commit
2e9ed76b0f
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      fhKeeper/formulahousekeeper/inva_4_tivo/js/iframe.js

+ 4 - 2
fhKeeper/formulahousekeeper/inva_4_tivo/js/iframe.js

@@ -7,7 +7,8 @@ const backcolor = {
   about: { background: 'none', color: '#000', logo: './image/logos.jpg' },
   dynamic: { background: 'none', color: '#000', logo: './image/logos.jpg' },
   customerNew: { background: '#fff', color: '#000', logo: './image/logos.jpg' },
-  knowledgeField: { background: '#fff', color: '#000', logo: './image/logos.jpg' }
+  knowledgeField: { background: '#fff', color: '#000', logo: './image/logos.jpg' },
+  noLinkAvailable: { background: '#fff', color: '#000', logo: './image/logos.jpg' }
 }
 
 function removeListener() {
@@ -35,7 +36,8 @@ function handleScroll() {
   let headerItems = iframeDocument.querySelectorAll('.header-item')
   let headerView = iframeDocument.querySelector('.headerView')
   const urls = window.location.href
-  const filed = urls.match(/\/([^\/]+)\.html$/) && urls.match(/\/([^\/]+)\.html$/)[1];
+  const filed = urls.match(/\/([^\/]+)\.html$/) && urls.match(/\/([^\/]+)\.html$/)[1] || 'noLinkAvailable';
+  console.log(filed, '<==== filed')
   if(scrollYnma > 1) {
     headerView.style.background = '#fff'
     imgElement.src = './image/logos.jpg'