浏览代码

minor fix

TC pushbot 5 4 年之前
父节点
当前提交
cd3b8dab83
共有 3 个文件被更改,包括 48 次插入8 次删除
  1. 3 4
      web/SystemAO/security/connlog.html
  2. 32 2
      web/SystemAO/system_setting/index.html
  3. 13 2
      web/script/ao_module.js

+ 3 - 4
web/SystemAO/security/connlog.html

@@ -55,11 +55,8 @@
         var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
 
         $(".ui.dropdown").dropdown();
-
-
         initMonthList();
        
-
         //Get the table that belongs to today. Put in offset if the current month not found in list
         function getCurrentMonthTable(monOffset = 0){
             const d = new Date();
@@ -95,7 +92,9 @@
 
                     //Select the current month if it exists
                     if (currentMontHTableExists){
-                        $("#recordTables").parent().dropdown("set selected", getCurrentMonthTable());
+                        setTimeout(function(){
+                            $("#recordTables").parent().dropdown("set selected", getCurrentMonthTable());
+                        }, 500);
                         loadRecordsByTableName(getCurrentMonthTable());
                     }
               

+ 32 - 2
web/SystemAO/system_setting/index.html

@@ -127,7 +127,9 @@
                     var settingModuleInfo = JSON.parse(decodeURIComponent($(targetObject).attr("moduleInfo")));
                     var settingStartDir = settingModuleInfo.StartDir;
                     $("#settingContentLoader").html("");
-                    $("#settingContentLoader").load("../../" + settingStartDir);
+                    $("#settingContentLoader").load("../../" + settingStartDir, function(){
+                        injectIMEToLoadedConetentFrame();
+                    });
                 }
               }
 
@@ -142,10 +144,38 @@
                     var settingModuleInfo = JSON.parse(decodeURIComponent($(targetObject).attr("moduleInfo")));
                     var settingStartDir = settingModuleInfo.StartDir;
                     $("#settingContentLoader").html("");
-                    $("#settingContentLoader").load("../../" + settingStartDir);
+                    $("#settingContentLoader").load("../../" + settingStartDir, function(){
+                        injectIMEToLoadedConetentFrame();
+                    });
                 }
               }
 
+              function injectIMEToLoadedConetentFrame(){
+                    //Inject IME listener into the loaded content window
+                    var inputFields = document.getElementById("settingContentLoader").querySelectorAll("input,textarea");
+                    for (var i = 0; i < inputFields.length; i++){
+                        if ($(inputFields[i]).attr("type") != undefined){
+                            var thisType = $(inputFields[i]).attr("type");
+                            if (thisType == "text" || thisType =="search" || thisType =="url"){
+                                //Supported types of input
+                                if (ao_module_virtualDesktop){
+                                    ao_module_bindCustomIMEEvents(inputFields[i]);
+                                }
+                                
+                                console.log(inputFields[i]);
+                            }else{
+                                //Not supported type of inputs
+
+                            }
+                        }else{
+                            //text area
+                            if (ao_module_virtualDesktop){
+                                ao_module_bindCustomIMEEvents(inputFields[i]);
+                            }
+                        }
+                    }
+              }
+
 
               function hideToolBar(){
                   $("#mainSideMenuDimmer").fadeOut('fast');

+ 13 - 2
web/script/ao_module.js

@@ -48,8 +48,19 @@ document.addEventListener("DOMContentLoaded", function() {
         //Add IME registration handler
         var inputFields = document.querySelectorAll("input,textarea");
         for (var i = 0; i < inputFields.length; i++){
-            console.log(inputFields[i]);
-            ao_module_bindCustomIMEEvents(inputFields[i]);
+            if ($(inputFields[i]).attr("type") != undefined){
+                var thisType = $(inputFields[i]).attr("type");
+                if ((thisType == "text" || thisType =="search" || thisType =="url")){
+                    //Supported types of input
+                    ao_module_bindCustomIMEEvents(inputFields[i]);
+                }else{
+                    //Not supported type of inputs
+
+                }
+            }else{
+                //text area
+                ao_module_bindCustomIMEEvents(inputFields[i]);
+            }
         }
     }
 });