Fix js bug.

This commit is contained in:
BoHung Chiu 2022-08-05 11:18:27 +08:00
parent 3e08373443
commit 329e9631b9
2 changed files with 20 additions and 6 deletions

View File

@ -690,7 +690,12 @@ var EventDialog = function(calendar,event){
}
}
this.esc_keydown = function(e){
var code = e.keyCode || e.which;
if( code ==27 ){
_t.hide();
}
}
this.show = function(pos){
event_quick_view.css({display: 'inline-block',width: '',height: '', position: "fixed", "z-index": "10000"});
var offset;
@ -698,7 +703,7 @@ var EventDialog = function(calendar,event){
if(pos){
offset = {"left":pos.x,"top":pos.y};
var pos = getPosition(pos);
event_quick_view.offset(offset);
event_quick_view.css(offset);
}else{
offset = {"left": padding, "top": padding};
}
@ -767,10 +772,12 @@ var EventDialog = function(calendar,event){
need_redisplay = true;
}
if(need_redisplay){
event_quick_view.offset(new_offset);
event_quick_view.css(new_offset);
event_quick_view.width(new_width);
event_quick_view.height(new_height);
}
$(document).off("keydown", _t.esc_keydown);
$(document).on("keydown", _t.esc_keydown);
}
this.hide = function(){
calendar.calendar_dom.find('.fc-popover-close').click();

View File

@ -486,7 +486,12 @@ var EventDialog = function(calendar,event){
'</div>';
}
this.esc_keydown = function(e){
var code = e.keyCode || e.which;
if( code ==27 ){
_t.hide();
}
}
this.show = function(pos){
event_quick_view.css({display: 'inline-block',width: '',height: '', position: "fixed", "z-index": "10000"});
var offset;
@ -494,7 +499,7 @@ var EventDialog = function(calendar,event){
if(pos){
offset = {"left":pos.x,"top":pos.y};
var pos = getPosition(pos);
event_quick_view.offset(offset);
event_quick_view.css(offset);
}else{
offset = {"left": padding, "top": padding};
}
@ -529,10 +534,12 @@ var EventDialog = function(calendar,event){
need_redisplay = true;
}
if(need_redisplay){
event_quick_view.offset(new_offset);
event_quick_view.css(new_offset);
event_quick_view.width(new_width);
event_quick_view.height(new_height);
}
$(document).off("keydown", _t.esc_keydown);
$(document).on("keydown", _t.esc_keydown);
}
this.hide = function(){
calendar.calendar_dom.find('.fc-popover-close').click();