Browse Source

修复无法弹出日期选择器

laiguoran 5 years ago
parent
commit
46ae8a9457
1 changed files with 9 additions and 1 deletions
  1. 9 1
      app/public/js/global.js

+ 9 - 1
app/public/js/global.js

@@ -89,6 +89,14 @@ $(function(){
     //     });
     //     $(this).css("overflow", "hidden");
     // });
+
+    // 动态生成datepicker
+    $('body').on('focus', ".datepicker-here", function (e) {
+        if ($(this).data("datepicker") != "1") {
+            $(this).datepicker();
+        }
+        $(this).data("datepicker", "1");
+    });
 });
 
 /**
@@ -364,4 +372,4 @@ function removeLocalCache(key) {
         return null;
     }
     return storage.removeItem(key);
-}
+}