Browse Source

Fix ESLint errors (#2763)

* fix dist/js/demo.js eslint error

* fix Layout.js eslint error

* remove unnecessary semicolon

* remove unexpected token

* add missing radix for parseInt in Layout.js
REJack 4 years ago
parent
commit
0641a8442d
2 changed files with 4 additions and 3 deletions
  1. 1 1
      build/js/Layout.js
  2. 3 2
      dist/js/demo.js

+ 1 - 1
build/js/Layout.js

@@ -131,7 +131,7 @@ const Layout = ($ => {
 
       if (this._config.loginRegisterAutoHeight === true) {
         this.fixLoginRegisterHeight()
-      } else if (Number.isInteger(this._config.loginRegisterAutoHeight)) {
+      } else if (this._config.loginRegisterAutoHeight === parseInt(this._config.loginRegisterAutoHeight, 10)) {
         setInterval(this.fixLoginRegisterHeight, this._config.loginRegisterAutoHeight)
       }
 

+ 3 - 2
dist/js/demo.js

@@ -366,8 +366,9 @@
   })
   $container.append($logo_variants)
   var $clear_btn = $('<a />', {
-    href: 'javascript:void(0)'
-  }).text('clear').on('click', function () {
+    href: '#'
+  }).text('clear').on('click', function (e) {
+    e.preventDefault()
     var $logo = $('.brand-link')
     logo_skins.forEach(function (skin) {
       $logo.removeClass(skin)