Revision: 2693
https://sourceforge.net/p/mrbs/code/2693/
Author: cimorrison
Date: 2013-02-11 07:30:40 +0000 (Mon, 11 Feb 2013)
Log Message:
-----------
Improved performance of drag selection, especially with large tables
Modified Paths:
--------------
mrbs/trunk/web/js/resizable.js.php
Modified: mrbs/trunk/web/js/resizable.js.php
===================================================================
--- mrbs/trunk/web/js/resizable.js.php 2013-02-10 19:06:42 UTC (rev 2692)
+++ mrbs/trunk/web/js/resizable.js.php 2013-02-11 07:30:40 UTC (rev 2693)
@@ -244,7 +244,7 @@
?>
function snapToGrid(tableData, div, side, force)
{
- var snapGap = (force) ? 100000: 20; <?php // px ?>
+ var snapGap = (force) ? 100000: 30; <?php // px ?>
var tolerance = 2; <?php //px ?>
var isLR = (side==='left') || (side==='right');
@@ -252,30 +252,32 @@
var topLeft, bottomRight, divTop, divLeft, divWidth, divHeight, thisCoord,
gap, gapTopLeft, gapBottomRight;
+
+ divTop = div.offset().top;
+ divLeft = div.offset().left;
+ divWidth = div.outerWidth();
+ divHeight = div.outerHeight();
+ switch (side)
+ {
+ case 'top':
+ thisCoord = divTop;
+ break;
+ case 'bottom':
+ thisCoord = divTop + divHeight;
+ break;
+ case 'left':
+ thisCoord = divLeft;
+ break;
+ case 'right':
+ thisCoord = divLeft + divWidth;
+ break;
+ }
for (var i=0; i<(data.length -1); i++)
{
topLeft = data[i].coord + <?php echo $main_table_cell_border_width ?>;
bottomRight = data[i+1].coord;
- divTop = div.offset().top;
- divLeft = div.offset().left;
- divWidth = div.outerWidth();
- divHeight = div.outerHeight();
- switch (side)
- {
- case 'top':
- thisCoord = divTop;
- break;
- case 'bottom':
- thisCoord = divTop + divHeight;
- break;
- case 'left':
- thisCoord = divLeft;
- break;
- case 'right':
- thisCoord = divLeft + divWidth;
- break;
- }
+
gapTopLeft = thisCoord - topLeft;
gapBottomRight = bottomRight - thisCoord;
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits