Timeline for Simplify Raphael JS code: display text in DIV on click event
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 7, 2014 at 1:19 | answer | added | Dan | timeline score: 1 | |
Dec 10, 2012 at 22:34 | answer | added | tiffon | timeline score: 0 | |
Sep 13, 2012 at 9:51 | comment | added | user1619342 | Great, thanks Dan Lee. I'll look into those more. Google to the rescue! :) | |
Sep 11, 2012 at 22:57 | history | post merged (destination) | |||
Sep 11, 2012 at 17:37 | history | edited | palacsint | CC BY-SA 3.0 |
edited tags
|
Sep 11, 2012 at 12:59 | history | migrated | from stackoverflow.com (revisions) | ||
Sep 11, 2012 at 9:41 | comment | added | Dan Lee |
You could user Paper.set and make an array of elements. I wouldn't add it to the context as class property. And btw, you can add 'cursor': 'pointer' to your attr . And at last: Don't use for..in , because it's very vulnerable, try Google :)
|
|
Sep 11, 2012 at 9:06 | comment | added | user1619342 | @MarkThomas I'll try codereview too, thanks. | |
Sep 11, 2012 at 9:04 | comment | added | user1619342 |
The part of code I'm hoping to simplify is the click handler (starting from var current = null; to the end of the code). The problem I'm having is trying to rebuild the click handler code - or even calling the function to be used elsewhere.
|
|
Sep 10, 2012 at 16:38 | comment | added | Kevin Nielsen | That is actually reasonably compact, straightforward code. Which part were you hoping to simplify, exactly? One thought: if the click handler is what you're focusing on, you can always declare the function independently and assign it by variable name, rather than reproducing it inline repeatedly. | |
Sep 10, 2012 at 10:13 | history | asked | user1619342 | CC BY-SA 3.0 |