Open joincamp opened 10 years ago
When initializing cdpad, positional data is truncated when using parseInt.
When using the following patch, results are as expected.
< g.cdpad += (isNaN(parseInt($('div', cdcol).css('borderLeftWidth'))) ? 0 : parseInt($('div', cdcol).css('borderLeftWidth')));
< g.cdpad += (isNaN(parseInt($('div', cdcol).css('borderRightWidth'))) ? 0 : parseInt($('div', cdcol).css('borderRightWidth')));
< g.cdpad += (isNaN(parseInt($('div', cdcol).css('paddingLeft'))) ? 0 : parseInt($('div', cdcol).css('paddingLeft')));
< g.cdpad += (isNaN(parseInt($('div', cdcol).css('paddingRight'))) ? 0 : parseInt($('div', cdcol).css('paddingRight')));
< g.cdpad += (isNaN(parseInt($(cdcol).css('borderLeftWidth'))) ? 0 : parseInt($(cdcol).css('borderLeftWidth')));
< g.cdpad += (isNaN(parseInt($(cdcol).css('borderRightWidth'))) ? 0 : parseInt($(cdcol).css('borderRightWidth')));
< g.cdpad += (isNaN(parseInt($(cdcol).css('paddingLeft'))) ? 0 : parseInt($(cdcol).css('paddingLeft')));
< g.cdpad += (isNaN(parseInt($(cdcol).css('paddingRight'))) ? 0 : parseInt($(cdcol).css('paddingRight')));
---
> g.cdpad += (isNaN(Math.round(parseFloat($('div', cdcol).css('borderLeftWidth')))) ? 0 : Math.round(parseFloat($('div', cdcol).css('borderLeftWidth'))));
> g.cdpad += (isNaN(Math.round(parseFloat($('div', cdcol).css('borderRightWidth')))) ? 0 : Math.round(parseFloat($('div', cdcol).css('borderRightWidth'))));
> g.cdpad += (isNaN(Math.round(parseFloat($('div', cdcol).css('paddingLeft')))) ? 0 : Math.round(parseFloat($('div', cdcol).css('paddingLeft'))));
> g.cdpad += (isNaN(Math.round(parseFloat($('div', cdcol).css('paddingRight')))) ? 0 : Math.round(parseFloat($('div', cdcol).css('paddingRight'))));
> g.cdpad += (isNaN(Math.round(parseFloat($(cdcol).css('borderLeftWidth')))) ? 0 : Math.round(parseFloat($(cdcol).css('borderLeftWidth'))));
> g.cdpad += (isNaN(Math.round(parseFloat($(cdcol).css('borderRightWidth')))) ? 0 : Math.round(parseFloat($(cdcol).css('borderRightWidth'))));
> g.cdpad += (isNaN(Math.round(parseFloat($(cdcol).css('paddingLeft')))) ? 0 : Math.round(parseFloat($(cdcol).css('paddingLeft'))));
> g.cdpad += (isNaN(Math.round(parseFloat($(cdcol).css('paddingRight')))) ? 0 : Math.round(parseFloat($(cdcol).css('paddingRight'))));
Maintainer: I've not contributed to this project before. Would you like me to check the change from the previous comment in? If so, how do you handle the minified file? Do you only update that on releases?
I get a similar issue whenever I'm at normal zoom level, the issue gets worse the farther right the column resides. See around line 165:
var cdcounter=0;
...
'left': (!(browser.mozilla) ? cdpos - cdcounter : cdpos) + 'px'
...
cdcounter++;
cdcounter is incremented for every column and used only in non-mozilla browsers. Simply removing cdcounter's usage fixes the issue. Confirmed working in latest Chrome, Firefox, IE10, and IE9 (compatibility mode) at the time of writing this comment.
Interestingly enough, I never get this issue with the demo grids on flexigrid's website. Inspecting the handle elements on my website in Chrome doesn't show them inheriting anything CSS styles. Very odd.
Overview: If the page is initially loaded using a preset zoom, the column drag elements will not line up correctly.
Browsers used: Chrome 29, Firefox 17, IE 8
Steps to reproduce: 1) Navigate to http://flexigrid.info/ (ensure that browser zoom level is 100% first) 2) Set browser zoom level to >100% (e.g. 175% for the following example) 3) Note that the drag elements line up correctly right now 4) Reload the page. (ensure that your browser zoom level retained. the grid must be initialized at the zoom level) 5) Find a column drag element from a right-most column. (at least 3rd column to demonstrate effect)![image](https://f.cloud.github.com/assets/4265597/1236967/ccb30f08-29cd-11e3-9eae-e66f42d937b6.png)