Re: [Proto-Scripty] is there a way to get an event type?
I would personally just make a single function that checks the event type and then do: function myClickFunction(event) { // click stuff } myObject.Observe('#blah:click', myClickFunction); myObject.Observe('#blah:dblclick', myClickFunction); I am not sure if there is a better way than that On Mar 14, 2010, at 6:40 PM, patrick wrote: Hi, I am using low pro's event behaviors, and currently am doing something like this: '#blah:click': function() { // click stuff } '#blah:dblclick': function() { // double click stuff } ... but I would like to minimize my code (since what I do with click vs double click is quite similar) into something like this: 'blah:click, blah:dblclick': function() { if (event == 'click') { // click stuff } else if (event == 'dblclick') { // double click stuff } } Is there a way to do that? -patrick -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] is there a way to get an event type?
Hi, I am using low pro's event behaviors, and currently am doing something like this: '#blah:click': function() { // click stuff } '#blah:dblclick': function() { // double click stuff } ... but I would like to minimize my code (since what I do with click vs double click is quite similar) into something like this: 'blah:click, blah:dblclick': function() { if (event == 'click') { // click stuff } else if (event == 'dblclick') { // double click stuff } } Is there a way to do that? -patrick -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Ajax.Request - can't get to work in Firefox, Chrome
Try using a relative URL, and prototype does not call activeX. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Table columns not sorted by Tablekit after AJAX call is added
Hi albert, In the tablekit library, there probably is a listener on window load event that will look for html table tags and perform actions on them. You should perform those actions when ajax updater succeed. Guillaume Le 13 mars 2010 à 17:19, albert kao a écrit : I use the Tablekit library and Prototype javascript framework on firefox, chrome & IE8. The columns in this table can be sorted by the Tablekit library. Code: ... ID Date Time However, after adding the periodic refresh by AJAX (eventually I want to refresh only the web page when there is new data available) and , then the columns in this table cannot be sorted by the Tablekit library. Code: ... ... ID Date Time -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Switch statement bugged with safari inside document.observe
Hi, I don't know if it is a bug, but if I have a switch statement with more than 2 cases defined. safari won't show any javascripts inside the switch body when it is used within document.observe("dom:loaded", function() {} here is my code: document.observe("dom:loaded", function() { //some initializing functions switch(x) { case 'a': brabrabra. break; case 'b': brabrabra. break; case 'c': brabrabra.. break; }// end of switch }); in safari, the function called before the switch will work, but all codes inside the switch won't. But it does work on IE and if I cut down cases to 2 cases, than it work again on safari. any help? -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.