Opened 13 years ago
Last modified 5 years ago
#9509 assigned defect
with IE9: chart doesn't resize to web page width
Reported by: | falkb | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
Automatic resizing to page width works with Firefox but the gannt chart has a fixed size of visible 970 pixels using Internet Explorer 9.0.8112.16421.
Attachments (0)
Change History (19)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|
comment:3 follow-up: 4 Changed 13 years ago by
more precise: the chart resizes to the window size only on reload of the page displayed in the browser window, but not on just a resize of the browser window.
comment:4 Changed 13 years ago by
Replying to falkb:
more precise: the chart resizes to the window size only on reload of the page displayed in the browser window, but not on just a resize of the browser window.
That's the behaviour with Firefox.
Actual problem: With IE, it doesn't resize on reload of the page either
comment:5 Changed 13 years ago by
The following patch fixes a runtime error where g was not defined and that newline after Draw() prevented from really setting the resize handler.
Now the event handler is really called if you resize the browser window! Resizing is sensibly slower now. Though we just get to the next bug, because calling Draw() in the handler function is not enough. Maybe you have an idea what else has to be called? I suspect DrawDependencies() at least as well...
-
tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py
174 174 text += 'var t;\n' 175 175 text += 'if (window.addEventListener){\n' 176 176 text += ' window.addEventListener("resize", ' + \ 177 'function() { g.Draw();\n}, false);\n'177 'function() { '+self.GanttID+'.Draw(); }, false);\n' 178 178 text += '} else {\n' 179 179 text += ' window.attachEvent("onresize", ' + \ 180 'function() { g.Draw();\n});\n'180 'function() { '+self.GanttID+'.Draw(); });\n' 181 181 text += '}\n' 182 182 return text
comment:6 Changed 13 years ago by
comment:7 Changed 13 years ago by
Status: | new → assigned |
---|
comment:8 follow-ups: 9 12 Changed 13 years ago by
Cool, FF works pretty well now, reload isn't necessary anymore, resizing the window is enough to make the chart resize. IE still doesn't resize at all and remains with that default size, for both, reload and resize of the browser window. Also after the necessary fix for [11117] (since :
-
tracjsganttplugin/tracjsgantt/tracjsgantt.py
183 183 'function() { '+self.GanttID+'.Draw(); ' 184 184 if options['showdep']: 185 185 text += self.GanttID+'.DrawDependencies();' 186 text += '} , false);\n'186 text += '});\n' 187 187 text += '}\n' 188 188 return text
comment:9 Changed 13 years ago by
Replying to falkb:
Cool, FF works pretty well now, reload isn't necessary anymore, resizing the window is enough to make the chart resize. IE still doesn't resize at all and remains with that default size, for both, reload and resize of the browser window. Also after the necessary fix for [11117] (since :
tracjsganttplugin/tracjsgantt/tracjsgantt.py
183 183 'function() { '+self.GanttID+'.Draw(); ' 184 184 if options['showdep']: 185 185 text += self.GanttID+'.DrawDependencies();' 186 text += '} , false);\n'186 text += '});\n' 187 187 text += '}\n' 188 188 return text
I'm confused. Are you saying that I need to remove the false
?
comment:11 Changed 13 years ago by
we need to remove the false but still resizing doesn't work and I don't know why and can't find something on the internet about that :(
comment:14 Changed 13 years ago by
I found http://www.codingforums.com/archive/index.php/t-228036.html where people discuss about that resize handler mess with all those different browsers. In the end it seems to me, for getting it work with IE, the resize handler function needs to get some widths from certain inner objects and set the value to the object which is to be resized... too tired for looking through now...
comment:15 follow-up: 17 Changed 13 years ago by
This fixes the chart width in IE for reload and resize, and by using this fix, FF and IE shows equal behaviour now!:
-
tracjsganttplugin/tracjsgantt/htdocs/jsgantt.js
1693 1693 { 1694 1694 // 95% of overall window width 1695 1695 width = window.innerWidth * 0.95 + 'px'; 1696 } else { 1697 width = document.documentElement.clientWidth * 0.95 + 'px'; 1696 1698 } 1697 1699 1698 1700 vDiv.style.width = width;
P.S.: I still see another problem with resize, I mean the vFormat selection always resets to 'day' after you've resized. One must always click the radiobutton to e.g. 'week' again. Somehow changeFormat() or setFormat() is connected with the onclick handler, only. I can see this problem with both browsers, FF and IE. What to do here now?
comment:17 follow-up: 18 Changed 13 years ago by
Replying to falkb:
P.S.: I still see another problem with resize, I mean the vFormat selection always resets to 'day' after you've resized. One must always click the radiobutton to e.g. 'week' again. Somehow changeFormat() or setFormat() is connected with the onclick handler, only.
This patch fixes it this way:
-
tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py
177 177 text += ' window.addEventListener("resize", ' + \ 178 178 'function() { ' + self.GanttID+'.Draw(); ' 179 179 if options['showdep']: 180 text += self.GanttID+'.DrawDependencies();'180 text += 'JSGantt.changeFormat("'+defaultFormat+'",'+self.GanttID+');' 181 181 text += '}, false);\n' 182 182 text += '} else {\n' 183 183 text += ' window.attachEvent("onresize", ' + \ 184 184 'function() { '+self.GanttID+'.Draw(); ' 185 185 if options['showdep']: 186 text += self.GanttID+'.DrawDependencies();'186 text += 'JSGantt.changeFormat("'+defaultFormat+'",'+self.GanttID+');' 187 187 text += '});\n' 188 188 text += '}\n' 189 189 return text
(Note: changeFormat internally calls DrawDependencies)
If no special radiobutton was clicked before, the chart keeps its format (as set in trac.ini) and doesn't switch to "day" anymore. This should be enough for most of all situations.
=> resolved="fixedforme" :-)
comment:18 Changed 13 years ago by
Replying to anonymous:
Replying to falkb:
P.S.: I still see another problem with resize, I mean the vFormat selection always resets to 'day' after you've resized. One must always click the radiobutton to e.g. 'week' again. Somehow changeFormat() or setFormat() is connected with the onclick handler, only.
This patch fixes it this way: ... If no special radiobutton was clicked before, the chart keeps its format (as set in trac.ini) and doesn't switch to "day" anymore. This should be enough for most of all situations.
=> resolved="fixedforme" :-)
Thanks but I really want to remember the format. I have a general idea how to do that that may even work across reloads of the page.
comment:19 Changed 5 years ago by
Cc: | Ryan J Ollos removed |
---|
uhm... I use latest svn revision of the plugin which is 10855