[Proto-Scripty] stylistic question about event management

2010-05-14 Thread orbiter
A quick question about event management. I have a button that toggles a style field on certain elements between two different values and here's the code that I use: function firstFunction(event) { $$(div[class='content']).invoke(setStyle,{height:50px}); $$(input[value='height

[Proto-Scripty] Re: stylistic question about event management

2010-05-14 Thread orbiter
Good points. 1. In a couple of places you're duplicating work, searching the DOM again for something you already have (such as when unhooking the old handler and hooking the new one) 2. It seems a bit odd that secondFunction is inside firstFunction, but it's not a big deal. 3. The code is

[Proto-Scripty] Ajax.Request and evalJS bug

2010-05-17 Thread orbiter
I've a little web app that loads and unloads pages with script tags in them and even though I pass evalJS: false to the Ajax.Request I still get an error message that says pq is not defined http://localhost/test/javascript/prototype.js Line 605 return this.extractScripts()... How can I prevent

[Proto-Scripty] Re: Ajax.Request and evalJS bug

2010-05-18 Thread orbiter
://api.prototypejs.org/dom/element/update/ [4]http://api.prototypejs.org/language/string/prototype/stripscripts/ HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On May 18, 5:35 am, orbiter dkarapet...@gmail.com wrote: I've a little web

[Proto-Scripty] selector documentation suggestion

2010-05-19 Thread orbiter
Usually the API documentation is really good because it clearly states all the inputs along with their types and the outputs along with their types but the documentation for the Selector object is a little sparse. More specifically the documentation for Selector.findChildElements does not make it

[Proto-Scripty] Re: readAttribute?

2010-05-20 Thread orbiter
I looked at the code and it seems that readAttribute has some extra plumbing for IE but other than that it works basically as you would expect. On May 19, 5:16 pm, patrick patrick99...@gmail.com wrote: Hi, I was looking over the API docs, and saw readAttribute, and thought to myself:  I have

[Proto-Scripty] Re: selector documentation suggestion

2010-05-20 Thread orbiter
` is documented. I'd probably stick to the higher-level interfaces -- `$$`, `Element#select`, `Element#down`, etc. -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On May 20, 6:56 am, orbiter dkarapet...@gmail.com wrote: Usually the API

[Proto-Scripty] storying and destroying metadata

2010-05-21 Thread orbiter
I recently discovered Element.store and Element.retrieve and I'm wondering a little about the semantics. Mainly I'm interested in the following use case: If I store some data and then delete the object on which I stored the data from the DOM tree what happens to the stored data? Do I need to worry

[Proto-Scripty] Re: Changing active state through Protoype

2010-05-21 Thread orbiter
I can think of a way of doing what you asked with some event management. The events I would mess with to get things to work would be mousedown, mouseup, mouseover, and mouseout. On May 21, 12:27 pm, thegdog theg...@gmail.com wrote: Should have mentioned that I am using Prototype version 1.6.0.2.

[Proto-Scripty] Re: Weird IE8 bug for click events with Element.observe for 1.7_rc2

2010-07-18 Thread orbiter
, 7:35 am, orbiter dkarapet...@gmail.com wrote: I have a button with an onclick callback that creates a closure and uses Element.observe to clear the old callback and set the closure as the new one. Here's the pseudo code: button onclick='original_handler.bind(this)(event)'button/button

[Proto-Scripty] Re: Weird IE8 bug for click events with Element.observe for 1.7_rc2

2010-07-18 Thread orbiter
return false didn't work but the timeout method did. Thanks for the help. On Jul 18, 9:38 am, orbiter dkarapet...@gmail.com wrote: Thanks, that explains a lot. I do most of my coding on firefox and chrome and IE always throws me for a loop. I'll go with return false and let you know how

[Proto-Scripty] Re: Weird IE8 bug for click events with Element.observe for 1.7_rc2

2010-07-18 Thread orbiter
setTimeout trick accomplishes. On Jul 18, 10:11 am, T.J. Crowder t...@crowdersoftware.com wrote: No worries. I'm not entirely surprised return false didn't work. Did you try Event.stop(event)? I'd give it no more than 50/50 odds... -- T.J. :-) On Jul 18, 5:45 pm, orbiter dkarapet...@gmail.com wrote