diff options
Diffstat (limited to 'web-ui/app/js/style_guide/main.js')
-rw-r--r-- | web-ui/app/js/style_guide/main.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/web-ui/app/js/style_guide/main.js b/web-ui/app/js/style_guide/main.js index 8dc2b949..170d1187 100644 --- a/web-ui/app/js/style_guide/main.js +++ b/web-ui/app/js/style_guide/main.js @@ -14,13 +14,15 @@ * You should have received a copy of the GNU Affero General Public License * along with Pixelated. If not, see <http://www.gnu.org/licenses/>. */ +'use strict'; + $(document).ready(function(){ $('a[href*=#]').click(function() { - if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') - && location.hostname == this.hostname) { + if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && + location.hostname === this.hostname) { var $target = $(this.hash); - $target = $target.length && $target - || $('[name=' + this.hash.slice(1) +']'); + $target = $target.length && $target || + $('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body') |