Browse Source

enhanced IFrame plugin
- fix error throw
- add tab close button hide/show with hover/focus

REJack 4 years ago
parent
commit
5b19f5e9aa
2 changed files with 21 additions and 2 deletions
  1. 2 2
      build/js/IFrame.js
  2. 19 0
      build/scss/pages/_iframe.scss

+ 2 - 2
build/js/IFrame.js

@@ -191,7 +191,7 @@ class IFrame {
         $(SELECTOR_TAB_EMPTY).show()
       } else {
         const prevNavItemIndex = navItemIndex - 1
-        this.switchTab($navItemParent.children().eq(prevNavItemIndex).find('a'))
+        this.switchTab($navItemParent.children().eq(prevNavItemIndex).find('a.nav-link'))
       }
     } else {
       const $navItem = $(`${SELECTOR_TAB_NAVBAR_NAV_ITEM}.active`)
@@ -203,7 +203,7 @@ class IFrame {
         $(SELECTOR_TAB_EMPTY).show()
       } else {
         const prevNavItemIndex = navItemIndex - 1
-        this.switchTab($navItemParent.children().eq(prevNavItemIndex).find('a'))
+        this.switchTab($navItemParent.children().eq(prevNavItemIndex).find('a.nav-link'))
       }
     }
   }

+ 19 - 0
build/scss/pages/_iframe.scss

@@ -28,6 +28,15 @@ body.iframe-mode-fullscreen {
       right: .125rem;
       top: .125rem;
       z-index: 10;
+      visibility: hidden;
+
+      &:hover,
+      &:focus {
+        animation-name: fadeIn;
+        animation-duration: $transition-speed;
+        animation-fill-mode: both;
+        visibility: visible;
+      }
     }
     .navbar-nav {
       overflow-y: auto;
@@ -38,6 +47,16 @@ body.iframe-mode-fullscreen {
       }
       .nav-item {
         position: relative;
+
+        &:hover,
+        &:focus {
+          .btn-iframe-close {
+            animation-name: fadeIn;
+            animation-duration: $transition-speed;
+            animation-fill-mode: both;
+            visibility: visible;
+          }
+        }
       }
     }
     .tab-content {