mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 06:05:31 +02:00
calendar MDL-23443 Attemped fix of calendar rendering problems
This commit is contained in:
parent
002f53ab32
commit
0c42353743
45
calendar/yui/eventmanager/eventmanager.js
vendored
45
calendar/yui/eventmanager/eventmanager.js
vendored
@ -13,34 +13,44 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
EVENT.superclass.constructor.apply(this, arguments);
|
||||
}
|
||||
Y.extend(EVENT, Y.Base, {
|
||||
initpanelcalled : false,
|
||||
initializer : function(config){
|
||||
var id = this.get(EVENTID), node = this.get(EVENTNODE);
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
var td = node.ancestor('td'), constraint = td.ancestor('div'), panel;
|
||||
var td = node.ancestor('td');
|
||||
this.publish('showevent');
|
||||
this.publish('hideevent');
|
||||
panel = new Y.Overlay({
|
||||
constrain : constraint,
|
||||
align : {
|
||||
node : td,
|
||||
points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.BC]
|
||||
},
|
||||
headerContent : Y.Node.create('<h2 class="eventtitle">'+this.get(EVENTTITLE)+'</h2>'),
|
||||
bodyContent : Y.Node.create('<div class="eventcontent">'+this.get(EVENTCONTENT)+'</div>'),
|
||||
visible : false,
|
||||
id : this.get(EVENTID)+'_panel',
|
||||
width : Math.floor(constraint.get('offsetWidth')*0.9)+"px"
|
||||
});
|
||||
panel.get('boundingBox').addClass('calendar-event-panel')
|
||||
panel.render(td);
|
||||
this.on('showevent', panel.show, panel);
|
||||
this.on('hideevent', panel.hide, panel);
|
||||
td.on('mouseenter', this.startShow, this);
|
||||
td.on('mouseleave', this.startHide, this);
|
||||
return true;
|
||||
},
|
||||
initPanel : function() {
|
||||
if (!this.initpanelcalled) {
|
||||
this.initpanelcalled = true;
|
||||
var node = this.get(EVENTNODE),
|
||||
td = node.ancestor('td'),
|
||||
constraint = td.ancestor('div'),
|
||||
panel;
|
||||
panel = new Y.Overlay({
|
||||
constrain : constraint,
|
||||
align : {
|
||||
node : td,
|
||||
points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.BC]
|
||||
},
|
||||
headerContent : Y.Node.create('<h2 class="eventtitle">'+this.get(EVENTTITLE)+'</h2>'),
|
||||
bodyContent : Y.Node.create('<div class="eventcontent">'+this.get(EVENTCONTENT)+'</div>'),
|
||||
visible : false,
|
||||
id : this.get(EVENTID)+'_panel',
|
||||
width : Math.floor(constraint.get('offsetWidth')*0.9)+"px"
|
||||
});
|
||||
panel.render(td);
|
||||
panel.get('boundingBox').addClass('calendar-event-panel');
|
||||
this.on('showevent', panel.show, panel);
|
||||
this.on('hideevent', panel.hide, panel);
|
||||
}
|
||||
},
|
||||
startShow : function() {
|
||||
if (this.get(SHOWTIMEOUT) !== null) {
|
||||
this.cancelShow();
|
||||
@ -52,6 +62,7 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
clearTimeout(this.get(SHOWTIMEOUT));
|
||||
},
|
||||
show : function() {
|
||||
this.initPanel();
|
||||
this.fire('showevent');
|
||||
},
|
||||
startHide : function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user