Author: nathangray
New Revision: 55803
URL: http://svn.stylite.de/viewvc/egroupware?rev=55803&view=rev
Log:
Some more performance improvements when scrolling through weeks:
- Fix typo causing unneeded time resize before redraw
- Change daycol resize & event sizing, eliminating the need to resize all events when daycol changes size
- Fix check for existing week by only checking day, not whole time
- Better handling of scrolling through weeks for faster update
Modified:
trunk/calendar/js/app.js
trunk/calendar/js/et2_widget_daycol.js
trunk/calendar/js/et2_widget_timegrid.js
— trunk/calendar/js/app.js (original)
+++ trunk/calendar/js/app.js Thu Apr 21 21:00:21 2016
@@ -1900,6 +1900,13 @@
var grid = view.etemplates[0].widgetContainer.getWidgetById('view');
-
// Show the templates for the current view
-
// Needs to be visible while updating so sizing works
-
for(var i = 0; i < view.etemplates.length; i++)
-
{
-
$j(view.etemplates[i].DOMContainer).show();
-
}
-
/*
If the count is different, we need to have the correct number
If the count is > 1, it's either because there are multiple date spans (weekN, month) and we need the correct span
@@ -2005,18 +2012,37 @@
// Swap DOM nodes
var a = grid._children[0].getDOMNode().parentNode.parentNode;
-
var a_scroll = $j('.calendar_calTimeGridScroll',a).scrollTop();
var b = grid._children[1].getDOMNode().parentNode.parentNode;
a.parentNode.insertBefore(a,b);
-
-
// Moving nodes changes scrolling, so set it back
-
var a_scroll = $j('.calendar_calTimeGridScroll',a).scrollTop(a_scroll);
}
}
else if (row_index > i)
{
// Swap DOM nodes
var a = grid._children[row_index].getDOMNode().parentNode.parentNode;
-
var a_scroll = $j('.calendar_calTimeGridScroll',a).scrollTop();
var b = grid._children[i].getDOMNode().parentNode.parentNode;
-
a.parentNode.insertBefore(a,b);
-
grid._children.splice(i,0,widget);
-
grid._children.splice(row_index+1,1);
-
-
// Simple scroll forward, put top on the bottom
-
// This makes it faster if they scroll back next
-
if(i==0 && row_index == 1)
-
{
-
$j(b).appendTo(b.parentNode);
-
grid._children.push(grid._children.shift());
-
}
-
else
-
{
-
grid._children.splice(i,0,widget);
-
grid._children.splice(row_index+1,1);
-
a.parentNode.insertBefore(a,b);
-
}
-
-
// Moving nodes changes scrolling, so set it back
-
var a_scroll = $j('.calendar_calTimeGridScroll',a).scrollTop(a_scroll);
}
break;
}
@@ -2045,12 +2071,17 @@
widget.set_granularity(view.granularity(state.state));
}
if(widget.id == value[row_index].id &&
-
widget.get_end_date().getUTCFullYear() == value[row_index].end_date.substring(0,4) &&
-
widget.get_end_date().getUTCMonth()+1 == value[row_index].end_date.substring(5,7) &&
-
widget.get_end_date().getUTCDate() == value[row_index].end_date.substring(8,10)
)
{
// Do not need to re-set this row, but we do need to re-do
// the times, as they may have changed
@@ -2091,11 +2122,6 @@
if(state.state.first && state.state.first.toJSON) state.state.first = state.state.first.toJSON();
if(state.state.last && state.state.last.toJSON) state.state.last = state.state.last.toJSON();
-
// Show the templates for the current view
-
for(var i = 0; i < view.etemplates.length; i++)
-
{
-
$j(view.etemplates[i].DOMContainer).show();
-
}
// Toggle todos
if(state.state.view == 'day' || this.state.view == 'day')
{
— trunk/calendar/js/et2_widget_daycol.js (original)
+++ trunk/calendar/js/et2_widget_daycol.js Thu Apr 21 21:00:21 2016
@@ -930,7 +930,7 @@
if(columns[c][i].div.is(’:visible’))
{
var border_diff = columns[c][i].div.outerHeight() - columns[c][i].div.height();
@@ -1074,10 +1074,18 @@
{
// Layout has changed
this._draw();
-
-
// Resize & position all events
-
this.position_event();
-
}
-
else
-
{
-
// Don't need to resize & reposition, just clear some stuff
-
// to reset for _out_of_view()
-
this.iterateOver(function(widget) {
-
widget._small_size();
-
}, this, et2_calendar_event);
-
}
this._out_of_view();
}
});}).call(this);
— trunk/calendar/js/et2_widget_timegrid.js (original)
+++ trunk/calendar/js/et2_widget_timegrid.js Thu Apr 21 21:00:21 2016
@@ -613,11 +613,20 @@
},
set_disabled: function(disabled) {
-
var old_value = this.options.disabled;
this._super.apply(this, arguments);
if(disabled)
{
this.loader.show();
}
-
else if (old_value !== disabled)
-
{
-
// Scroll to start of day - stops jumping in FF
-
// For some reason on Chrome & FF this doesn't quite get the day start
-
// to the top, so add 2px;
-
this.scrolling.scrollTop(this._top_time+2);
-
}
-
},
/**
@@ -761,7 +770,7 @@
window.clearTimeout(this.resize_timer);
}
// No point if it is just going to be redone completely
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs