Skip to content

Update datetimePicker.js #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dist/js/datetimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@
parent += '<div class="ui-picker-slot"id="picker-'+ i +'"><ul class="ui-picker-list">'+ _this.itemTemplate(i) +'</ul></div>';
};
_this.pickerbody.append(parent);
//判断是否存在多次new实例 多次new 只创建一次dom 解决多次new实例创建多个dom引发的无法选择时间的bug
if( $(".ui-picker-wrap").length>0){
return;
}
$body.append(this.pickerWrap);
for(var i=0; i<arr.length;i++){
(function(i){
Expand Down Expand Up @@ -264,4 +268,4 @@
$.datetimePicker = function(config){
return new DatetimePicker(config);
}
})(window.jQuery || $);
})(window.jQuery || $);