| Summary: | Parent div for compare widget has to be in the DOM | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Szymon Brandys <Szymon.Brandys> |
| Component: | Git | Assignee: | libing wang <libingw> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | gabriel.luong, libingw, susan |
| Version: | 0.2 | ||
| Target Milestone: | 4.0 M1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 379567 | ||
|
Description
Szymon Brandys
I'm not sure who should be looking at it. I opened a general bug (bug 379567) about this issue. This is a specific case. if the timeout hack is working for now, I would recommend that we look at this issue as a whole, using this case as a use case, but perhaps not in 0.5. For 1.0 I'd like to have some kind of dom insertion event that our widgets fire. Taking this bug because it's a good use case....using the event instead of a timeout. Libing is reworking compare widget to get rid of dojo and border container. It may change the need for this. At any rate we should recheck the situation when compare widget is dijit-free. I will keep an eye on it before the un-dojo is done. I believe Gabriel did something removing the delay of the compare rendering. Not sure that is related to this bug. I noticed this problem since we would use the timeout to wait for the parent div to be added to the dom before rendering the compare widget. However, that isn't really needed. Since we already created the parent div (although not yet added to the dom), the render function failed because we passed in the parent div id, instead of the parent div object (<div id="parent">...</div>) and lib.node() would throw because it cannot find the parent in the dom given the node id. However, passing the dom element object directly will allow us to continue modifying the object. You can view the changes I did to remove the delay in rendering the stage/unstage buttons and compare widget in http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3dbb8cea6547859e9ff43d3118ad0f71e6bac86c Sample of the change (taken from gitStatusExplorer.js): Before: - passing in the dom element id > var diffActionWrapper = document.createElement("span"); //$NON-NLS-0$ > diffActionWrapper.id = "unstaged" + item.name + "DiffActionWrapper"; //$NON-NLS-0$ > ... > div.appendChild(diffActionWrapper); > window.setTimeout(function() { > that.commandService.destroy(diffActionWrapper.id); > that.commandService.renderCommands( > "DefaultActionWrapper", diffActionWrapper.id, item, that, "tool", null, navGridHolder); //$NON-NLS-1$ //$NON-NLS-0$ > }, 300); After: - passing in the dom element object > that.commandService.destroy(diffActionWrapper); > that.commandService.renderCommands( > "DefaultActionWrapper", diffActionWrapper, item, that, "tool", null, navGridHolder); //$NON-NLS-1$ //$NON-NLS-0$ Also, refer to Bug 410530 - Remove delay in rendering of the compare widget and stage/unstage buttons in git status and git commit explorer fixed in Bug 410530. *** This bug has been marked as a duplicate of bug 410530 *** |