Displaying 20 results from an estimated 82 matches for "bindaseventlisten".
Did you mean:
bindaseventlistener
2006 Feb 27
3
bindAsEventListener with parameters
I would like to share a modification to bindAsEventListener() that
might be useful to some of you. It makes it possible to do
function show(event, number) {
alert(Event.element(event).id + " = " + number);
}
Event.observe("el1", "click", show.bindAsEventListener(this, 5);
Event.observe("el2", "click",...
2006 Mar 04
1
RE: Question about event listener highlighting withchild elements
...his behavior
elsewhere when you need it in the future):
Object.extend(this.el, HighlightBehaviorClass.prototype)
2. When defining your event handlers, assign them to variables so you
have a handle to properly dispose of them, like this:
this.mouseOver_Listener = this.highight.bindAsEventListener(this);
Event.observe(this, "mouseover", this.mouseOver_Listener);
...now this will work...
Event.stopObserving(this, "mouseover", this.mouseOver_Listener);
________________________________
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane...
2006 Jun 19
2
Autocompleter enhancement feature request
...leter to show the
options immediately when the field gets focus. Right now at least one
character must be typed for autocomplete to kick in.
http://dev.rubyonrails.org/ticket/5435
I have also made some code changes directly in the script
Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this));
Event.observe(this.element, "focus", this.onKeyPress.bindAsEventListener(this));
The last line is what I have added.
And then I have commented some code:
onObserverEvent: function()...
2005 Oct 17
0
Explaination of bindAsEventListener
I am wondering if someone can explain what bindAsEventListener is used
for and some common uses that I would use it for.
Thanks,
<http://zend.com/zce.php?c=ZEND002524&r=212822110>
Jon Whitcraft
Indianapolis Motor Speedway
jwhitcraft-1LwPDYEpVrH2eFz/2MeuCQ@public.gmane.org
Phone: (317) 492-8623 :: Fax: (317) 492-6419
****************...
2006 Mar 03
11
event.keyCode broken in prototype?
I ran 2 tests. One using proto''s Event.observe, and another using an
in-line handler of the "keydown" event in a textbox.
Using .bindAsEventListener, the event.keyCode is always returning a
capital letter, no matter what. The in-line event handler returns
lowercase vs. uppercase correctly... What''s going on?
I guess I find it hard to believe no one has tried capturing keyboard
events before, so I''m hoping I''m ju...
2006 Jun 15
3
RE: Yahoo!-like Eventobjectemulation/abstractioninPrototype?
This is obviously rough draft and not thoroughly tested, but it seems to
work. If you''d like, give it a try (load it after you load
prototype.js):
Function.prototype.bindAsEventListener = function(object) {
var __method = this;
return function(event) {
return __method.call(object, new SuperEvent(event || window.event));
}
}
var SuperEvent = Class.create();
Object.extend(SuperEvent.prototype, {
initialize: function (event) {
for (attr in event) {
this[attr]...
2006 Feb 02
8
this pointer in Event.observe function
Hello,
please consider the following code example. It applies the onclick handler to
all image tags, and through window.event it ensures that it works in IE too:
--------------------------------------------------
var imgs = $(''foo'').getElementsByTagName(''img'');
for(var i=0; i<imgs.length; i++) {
// Apply onclick handler
imgs[i].onclick=function() {
2006 Mar 04
0
Question about event listener highlighting with child elements
....prototype = {
idPath : 0,
console : '''',
oBackgroundColor : '''',
el : '''',
initialize: function(value) {
this.idPath = findSecurityIdPath(value);
//Event.observe(value, ''click'',
this.activate.bindAsEventListener(this),
false);
this.el = value;
Event.observe(value, ''mouseover'',
this.highlight.bindAsEventListener(this),
false);
Event.observe(value, ''mouseout'',
this.unhighlight.bindAsEventListener(this), false);
value.onclick = function(){r...
2006 Jun 15
10
RE: Yahoo!-like Event object emulation/abstractioninPrototype?
...ls-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> Subject: Re: [Rails-spinoffs] Yahoo!-like Event object
> emulation/abstractioninPrototype?
>
> On Thu, Jun 15, 2006 at 11:28:03AM -0600, Gregory Hill wrote:
> # Event.observe(myelement, ''click'', myfunc.bindAsEventListener());
> #
> # That might fix your wagon.
>
> That didn''t seem to make any difference. FF still works, IE still
> does not. I''m not branching for window.event in my callback/listener.
>
> I''m asking about a level of abstraction/emulation like is desc...
2005 Aug 31
0
Event listener problems
I''ve been using the bindAsEventListener function and registering
various events I want to monitor and have had some problems which
might be of interest.
First I have been having a crash on Safari 2.0 and 2.0.1. The
logical place to call Event.stopObserving to de-register the listener
is actually within the listener once it ha...
2006 Apr 29
4
Event.observe mystery
...thod (simplified)
looks like this:
addItem: function(itemId, text)
{
this.container.innerHTML += ''<div id="''+itemId+''">''+text+''</div>'';
Event.observe(itemId, ''mouseover'',
this.onMouseOverHandler.bindAsEventListener(this), false);
}
I call my class in the following way:
var myMenu = new Menu();
myMenu.addItem(''item1'', ''Item 1'');
myMenu.addItem(''item2'', ''Item 2'');
myMenu.addItem(''item3'', ''Item 3'');
A...
2006 Feb 10
13
Element.observe () binding
Hey all,
I working on a project, but I am not sure I can do what I want to
do. The following works beautifully:
Event.observe(el, ''click'', function () { this.className += "
myClass"; return false; });
I have also tried doing this:
this.varname = ''test'';
Event.observe(el, ''click'', function () { alert (this.varname); }.bind
2006 Jun 15
3
RE: Yahoo!-like Event object emulation/abstractionin Prototype?
Event.observe(myelement, ''click'', myfunc.bindAsEventListener());
That might fix your wagon.
Greg
> -----Original Message-----
> From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-
> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Sam Rowe
> Sent: Thursday, June 15, 20...
2006 Mar 31
7
Reset events after ajax update
Avoiding real work I decided to try and clean up my html and remove my
inline onclick handlers for Ajax.Updater calls. Here''s the inline
method I''ve been using:
http://hank.org/demos/ajax-inline.html
Now, here''s using <script> sections to apply the behavior.
http://hank.org/demos/ajax.html (firefox only)
Since the links (tabs) are inside the
2007 Jul 16
4
Problem with keypress event handling
...owser Javascript control that enhances the
HTML text input element in order to accept only digits (more or less).
Supposing that ''domText'' is the DOM element corresponding to the HTML
text input, we wrote the following:
Event.observe(domText, "keypress",
this.onKeyPress.bindAsEventListener(this));
where
this.onKeyPress = function(evt) {
var evtc = evt.keyCode; // char code for IE and Opera
if (evtc == 0 || evtc == null) {
// Firefox
evtc = evt.charCode;
}
if (evtc >= 48 && evtc <= 57) {
// Digit
return tr...
2008 Mar 05
6
Prototype Observe Links (Mouseover)
...totype Event.observe. All
links with the class "dropdown" should be observed for onmouseover
events and execute the function showSubnavi(this) - the ''this''
argument shouldn''t be lost and i think thats the tricky part.
Im sure the soultion includes something with bindAsEventListener, but
I didn''t really get that.
Thank you alot!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5...
2006 Mar 16
3
This is driving me crazy!!!
....getElementsByTagName(''input'');
inputs = $A(inputs);
inputs.each( function(input) {
try {
if(validInputs.indexOf(input.id) != -1) {
//input.onblur = this.alertBox.bindAsEventListener(this);
Event.observe(input.id,''blur'',this.alertBox.bind(this),false);
}
} catch(e) {
alert(e);
}...
2006 May 09
5
anyone used the new firefox leak monitor?
One of the Mozilla developer released a new extension to detect JS
memory leaks:
https://addons.mozilla.org/firefox/2490/
If it''s accurate, it might be bad news for Prototype. I have some code
using prototype 1.4 with no leaks, but other code with 1.5 leaks on
every single bindAsEventListener call, and a bunch of other places. Not
sure if it''s just me; I may just be using it incorrectly on the one
project. But, I can''t see anything at first glance to indicate that.
Just downloaded the newer version of the plugin, so I''ll do some more
digging. Anyone e...
2007 Aug 16
4
prototype: Event.observe 'click' for $$('a.popout')
...working to tell
firefox not to follow the link
-----------------------------------
I have also tried using an anomyomous function within Event.observe
and just to ease my brain, i tried this:
$$(''a.popout'').each( function(s) { Event.observe( s, ''click'',
popout.bindAsEventListener(s) ) } );
which shouldnt be any different to a standard event.observe, and
isn''t!
thanks for reading, any insights would be much appreciated.
The reason im doing it this way and not in the html :
< a href="somelink.php" class="popup" onclick="popup(); retu...
2006 Mar 15
3
prototype.js Event.stopObserving
anyone have any information on how to effectively use this?
Event.observe() doesn''t return anything, and nothing I''ve tried is actually
removing the event listeners from the objects.
-Jeremy
--
Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org
In the beginning was The Word and The Word was Content-type: text/plain
-- The Word of Bob.