diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 11e3fa0..38647a3 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -2,36 +2,6 @@ // ECMAScript 5 嚴格模式 'use strict'; $(function() { - var $signLanguageBox = $('.orbit-bar-search-sign-language'); - var $headerNav = $('.header-nav'); - var $target = $('.header-nav [accesskey="U"], .header-nav [accesskey="W"]'); - - // 移除 color: inherit !important - $target.each(function() { - $(this)[0].style.removeProperty('color'); - }); - - function handleNavMove() { - var windowWidth = window.innerWidth; - - if (windowWidth > 768) { - if ($signLanguageBox.length && $signLanguageBox.find('[accesskey="U"], [accesskey="W"]').length === 0) { - $signLanguageBox.prepend($target); - } - } else { - if ($headerNav.length && $headerNav.find('[accesskey="U"], [accesskey="W"]').length === 0) { - $headerNav.append($target); - } - } - } - - handleNavMove(); - - $(window).on('resize', function() { - handleNavMove(); - }); - }); - $(function() { var $target = $('.header-nav [accesskey="U"], .header-nav [accesskey="W"]'); // 移除 color: inherit !important $target.each(function() { @@ -2830,24 +2800,20 @@ $(document).ready(function() { }); $(document).ready(function() { $('a[href="/zh_tw/sitemap"]').html(''); - $('a[href="/en/sitemap"]').html('') - // 找到 Sitemap 連結 - var $sitemapLink = $('a[href="/zh_tw/sitemap"]'); - - // 找到目標容器 - var $target = $('.searchclass'); - - // 移動到容器內的最前面 - if ($sitemapLink.length && $target.length) { - $sitemapLink.prependTo($target); - } - var $sitemapLink = $('a[href="/en/sitemap"]'); - - var $target = $('.searchclass'); + $('a[href="/en/sitemap"]').html(''); - if ($sitemapLink.length && $target.length) { - $sitemapLink.prependTo($target); - } + // 中文版:只移動 .header-nav 裡的 + var $sitemapLink = $('.header-nav a[href="/zh_tw/sitemap"]'); + var $target = $('.searchclass'); + if ($sitemapLink.length && $target.length) { + $sitemapLink.prependTo($target); + } + + // 英文版:只移動 .header-nav 裡的 + var $sitemapLinkEn = $('.header-nav a[href="/en/sitemap"]'); + if ($sitemapLinkEn.length && $target.length) { + $sitemapLinkEn.prependTo($target); + } }); //post $(document).ready(function () { diff --git a/assets/stylesheets/template/base/_accesskey.scss b/assets/stylesheets/template/base/_accesskey.scss index 3fdd8d7..d8c9ece 100644 --- a/assets/stylesheets/template/base/_accesskey.scss +++ b/assets/stylesheets/template/base/_accesskey.scss @@ -1,8 +1,7 @@ @charset "utf-8"; a[accesskey] { - position: absolute; - margin-left: -0.9375em; + position: relative; color: transparent ; } diff --git a/home/header.html.erb b/home/header.html.erb index e0f1883..5b5d823 100644 --- a/home/header.html.erb +++ b/home/header.html.erb @@ -22,10 +22,10 @@