Displaying 20 results from an estimated 10000 matches similar to: "Removing all event listeners"
2006 Mar 04
1
RE: Question about event listener highlighting withchild elements
1. Create a separate class that has your highlight/unhighlight behavior
in it, and extend just the element you want to highlight with that
class... like this (also allows you to easily apply this 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
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.
2006 Jan 18
2
Event.stopObserving and anonymous functions
Hi all,
I'm using behaviour(.js) to add event handlers to all the table cells
in a table (mouseover, mouseout, clickk). However, I'm also ditching
the table and replacing it with an Ajax.Updater so I want to remove
all the observers before I lose them. Unfortunately, the Event.observe
calls were written as inline anonymous functions so, when calling
Event.stopObserving, I'm supposed
2006 Dec 14
17
Should Event.stopObserving() remove itself from cache?
Just wondering why Event.stopObserving() doesn''t remove the itself from
the Event.obervers array?
Is there a reason for this?
--~--~---------~--~----~------------~-------~--~----~
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
2006 Feb 27
11
Disabling anchor clicking in a draggable
Hey guys
I have an interesting problem - I have some draggable elements (sortable
actually), with links (<A>) inside them. I want the user to be able to
click on the link, however if the user drags the element I don''t want
the link to get fired. Can anyone think of a way to do this? It only
needs to work in Firefox.
Cheers
-Rob
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 Aug 17
6
Creating Custom Events using prototype
Hi guys!
i know prototype can create custom events and can subscribe to it, but is
there already a library for this?
thanks!
--
<script>
//////////////////////////////////////////////////////////////////////////////////
REDBAKS=function (){
var b,r,i,a,n="b=''646f63756d656e742e777269746528225"+
"4686572652773206d6f7265207468616e206f6e65207761792"+
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
2006 Feb 14
7
onFailure fails?
Hi all,
I have this code:
new Ajax.Request(''non_existant.file'', {
onSuccess:function(){alert("yay");},
onFailure:function(){alert("boo");}
});
Why does the onFailure alert never get called? It works fine if I use
a real file (onSuccess gets called).
Thanks,
Douglas
2006 Mar 03
6
[PATCH] Effect.Accordion (not from the wiki)
Hello boys and girls
In the ever-loving spirit of OSS, here''s another feature for s.a.u.
In particular it''s called Effect.Accordion, and is a scriptaculified
version of openrico''s Accordion.
Work in progress, I''ll submit further modifications as the come in, but
this is 90% of what needs to be done. I anticipate some bugs when I
start using it more.
Tested
2006 Mar 01
4
[Fwd: [PATCH] Allow generic autocompleter (Ajax.Watcher)]
Patch to allow generic Ajax.Autocompleter-style textbox watchers.
Forwarded for "[Rails-spinoffs] Delayed input posting"
-Rob
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
2006 Feb 01
2
IE memory fix leak.
By default the prototype.js gives us the function
/* prevent memory leaks in IE */
Event.observe(window, ''unload'', Event.unloadCache, false);
But there is no unload event in out application as the content of the div
keeps changing using the Ajax.Updater function. To handle such a scenario,
we''ve added the following lines of code to prototype.js
/* prevent
2006 Feb 10
1
Stopping an observe event
If I want to stop observing a div Is this the format?
Event.stopObserving($(''''mydiv''),''click'');
Deco
2009 Sep 27
1
Switchboard - Easy to use global ActiveRecord event listeners
Switchboard is a simple, event-observing framework for ActiveRecord.
It''s designed to make it easy to add observers for all models in your
app, and to easily turn them on and off selectively.
Intallation
gem sources -a http://gems.github.com
sudo gem install zilkey-switchboard
Usage
First, require switchboard above your rails initializer:
# environment.rb
require
2007 Aug 31
5
prototype
Hi,
is there some way to remove all event listeners for the specific
element?
Thanks for help.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group,
2006 Feb 09
3
Draggables and Droppable performance (tips)
Hi all. I have some performance tips to share. I had been having
problems with the overall performance of the drag/drop objects. This is
due largely to the fact that my project really pushes the limits
(potentially thousands of draggables and hundreds of droppables in the
document at a time, although that is the extreme case).
Something I discovered is that the performance of dragging goes WAY
2005 Dec 14
1
Problem stopping default event in Safari
I''m going crazy here. I''m trying to stop a link from being followed
after it''s clicked. It works everywhere except Safari (using v. 2.0.2
on Tiger)
I''m using behavior.js to attach events based on a class or an id:
*******************************************************
function loadData(e) {
// load some data here based on the url of the a tag
2006 Mar 07
6
[PATCH] Allow Ajax.InPlaceCollectionEditor to load collection externally
Attached is a patch to allow Ajax.InPlaceCollectionEditor to load the
collection using AJAX.
It adds a new option, loadOptionsURL, which is the URL used to load the
values over the interweb. It expects the server to return
<option></option> values. If one of them has a selected="selected"
attribute, it will probably be pre-selected. Not tested that though.
Also only tested
2006 Mar 04
0
Question about event listener highlighting with child elements
I have created a JavaScript object which is initialized for some input
fields, fieldsets, and divs on the page. With each object i attach a
mouseover and mouseout event that highlights and un-highlights. Also on
mouseout i am trying to display the id of the object to a console. The
highlighting works except for cases when an object is the child of another
object. In this case both are highlighted
2006 Oct 20
1
Event.observe vs. element.onxxx =
What are the pros and cons of using Event.observe vs. element.onxxx =
somefunction ?
I noticed that a lot of sau code doesn''t use Event.observe. For example,
InPlaceEditor uses
this.form.onsubmit = this.onSubmit.bind(this);
In my code I''ve made a habit of using the equivalent (for example):
this.onSubmitListener = this.onSubmit.bind(this);