Browse Source

Auto scroll to make moe visible when opened

Vijayakrishnan Krishnan 4 years ago
parent
commit
74ebd5186a
3 changed files with 6 additions and 2 deletions
  1. 1 1
      public/js/mc.js
  2. 4 0
      public/js/yemi.js
  3. 1 1
      resources/views/layouts/template.blade.php

+ 1 - 1
public/js/mc.js

@@ -144,7 +144,7 @@ function onFastLoaded(_data, _href, _history) {
     var content = $(_data).find('.stag-content');
     if (content && content.length) {
         content = content.html();
-        content += '<script src="/js/yemi.js?_=6"></script>';
+        content += '<script src="/js/yemi.js?_=7"></script>';
         targetParent.html(content);
         window.setTimeout(function() {
             initCreateNote();

+ 4 - 0
public/js/yemi.js

@@ -309,6 +309,10 @@ var initMoes = function() {
                                 $('[moe]>form:not([show]):visible').hide();
                                 $(realForm).toggle(100);
                                 initPrimaryForm($(realForm));
+                                setTimeout(function() {
+                                    let submitButton = $(realForm).find('[submit]');
+                                    if(submitButton.length) submitButton[0].scrollIntoView({behavior : "smooth"});
+                                }, 150);
                             }, 100);
                         }
                     }

+ 1 - 1
resources/views/layouts/template.blade.php

@@ -32,7 +32,7 @@
     <script src="{{ asset('js/app.js') }}" type="application/javascript"></script>
     <script src="/js/jquery-3.5.1.min.js"></script>
     <script src="{{ asset('js/toastr.min.js') }}" type="application/javascript"></script>
-    <script src="/js/yemi.js?_=6" type="application/javascript"></script>
+    <script src="/js/yemi.js?_=7" type="application/javascript"></script>
 
     {{-- med ac --}}
     <link href='/css/autocomplete-lhc.min.css' rel="stylesheet">