Displaying 20 results from an estimated 2000 matches similar to: "Behaviour.js and prototype Event.observe"
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 Feb 20
0
prototype.js Array.prototype.shift() method
I noticed that prototype.js defines a shift() method for the Array prototype.
The base prototype already defines this method, is there a reason it is being
redefined in prototype? Maybe certain browsers aren''t implementing the
shift() method? If that''s the case, shouldn''t there also be an unshift()? :)
Thanks!
-Jeremy
--
Jeremy Kitchen ++
2006 May 01
2
[prototype] Selector class fails on selector strings with spaces
I just ran across this bug when trying to re-create Ben Nolan''s behaviour.js
with prototype and was wondering if anyone had fixed it before I went
re-inventing the wheel :)
Thanks!
-Jeremy
--
Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org
http://ipaction.org/ -- defend your rights to fair use
_______________________________________________
2006 Apr 17
2
RE: document.getElementsByClassName (prototype) andElement.childrenWithClassName (scriptaculous) redundancy?
Isn''t the difference that the scriptaculous one only gets child nodes
from the node you specify, whereas the prototype one gets all in the
entire document?
Still, it would be nice to just have the one, and let you pass in the
document element if you wanted all of them.
Just guessing, really. I haven''t looked at the code in question.
Greg
> -----Original Message-----
>
2006 Jan 11
2
extending the Element.prototype to provide a setAttributes function
Hi folks, I''m pretty new to javascript and prototype, so I just want to get
some peer-review on a function I wrote that makes a handy (at least, it seems
handy) way to set a group of attributes on an element easily.
Object.extend(Element.prototype, {
setAttributes: function(attrs) {
var el = this;
$H(attrs).each( function(attr) {
el.setAttribute(attr[0], attr[1]);
2006 Apr 17
1
document.getElementsByClassName (prototype) and Element.childrenWithClassName (scriptaculous) redundancy?
Is there a reason scriptaculous provides what appears to be a redundant
function? The reason I''m asking is that it only seems to be used twice
throughout all of scriptaculous, and it doesn''t appear to work properly (for
some reason it''s returning the actual element, rather than an array with all
of the elements)
If there is no reason, I''ll modify it to use
2006 Jan 11
2
RE: extending the Element.prototype to provide asetAttributes function
No comment on the usefulness of your function, as I''ve yet to try it.
But for the "this" scope problem, try this... (removed your var and
added the bind(this) after the function declaration. I didn''t test it
though so you might want to give it whirl. It might introduce a
different scope problem with the "attr" var but I think it should work.
2006 Jan 27
1
[prototype] [BUG] Event.stop doesn''t stop all keystrokes on some browsers
attached is an html file I used to test the bug. the top text box should not
allow you to type anything, not tab, not enter, nothing. bottom text box
should work fine.
requires prototype.js and includes jslog for jslog.info although it only
occurs in one place, I just wanted to make sure the event was firing without
having to use alerts :)
tested browsers/platforms:
opera: mac / win / lin:
2006 Jan 11
0
RE: extending the Element.prototype to provideasetAttributes function
No problem, also check out bindAsEventListener for attaching functions
to element events, still maintaining your object as the "this" in the
event handler scope at the same time having access to the originating
"event" object.
In case you haven''t found this resource yet:
http://www.sergiopereira.com/articles/prototype.js.html
-----Original Message-----
From:
2006 May 25
7
prototype-ish subclassing
when using prototype and Class.create(), what''s the preferred method of
creating a subclass?
say I have a real simple class:
var Testing = Class.create();
Object.extend(Testing.prototype, {
initialize: function() {
...
},
...
});
would I subclass it as so?
var SubClass = Class.create();
Object.extend(Object.extend(SubCLass.prototype, Testing.prototype), {
...
2006 Mar 08
2
RE: question about auto-updating div withoverflow:auto and maintaining position
You should be able to do this by changing the div''s .scrollTop value via
javascript (maybe just pick a very large number to ensure bottom is hit,
like 10,000).
-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of
Jeremy Kitchen
Sent:
2006 Mar 09
0
RE: question about auto-updating divwithoverflow:auto and maintaining position
No problem!
-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of
Jeremy Kitchen
Sent: Wednesday, March 08, 2006 5:39 PM
To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: Re: [Rails-spinoffs] question about auto-updating
2006 Mar 08
0
question about auto-updating div with overflow:auto and maintaining position
I have a div (with overflow:auto) that gets stuff added to it via
Ajax.PeriodicalUpdater, and I''d like to keep it scrolled to the bottom all
the time, unless the user manually scrolls away from the bottom (and be able
to return it to its bottom-sticky form afterwards)
I''m not sure if this is just some css trickery I need to do, or if it requires
some javascript to do it.
2006 Apr 07
4
Effect.toggle error in 1.6.1
I have this line of code:
new Effect.toggle(document.getElementsByClassName(''modarea'',
Event.findElement(ev,''li'')), ''blind'');
I''ve confirmed that the Effect.toggle is indeed getting the proper element,
however, I''m getting this in my javascript console:
element.visible is not a function (effects.js: line 153)
I
2006 Jun 14
5
generic onDragStart onDrag and onDragFinish events extracted from scriptaculous?
Hi folks.
I''m working on a project where I need some drag and drop, but I need to
implement what happens in a very different way, so I''m creating my own class
for it. I don''t want to reinvent the wheel and redo Thomas'' excellent
drag/drop functionality, nor do I want to copy/paste his code over into mine.
So, I was wondering, has anyone tried to extract
2006 Feb 02
3
dynamic addition of table rows
Hi, I have a table laid out something like this:
<table>
<thead>
<tr>
<th>col 1</th>
<th>col 2</th>
</tr>
</thead>
<tbody id="tablebody">
<tr>
<td>moo</td>
<td>moo</td>
</tr>
<tr>
<td>moo</td>
<td>moo</td>
</tr>
2006 Nov 04
0
Prototype observe issues
I have tried a couple of different ways to do the following (using
unobtrusive javascript) as well as straight javascript. So far the
only way that I have been able to get it to work is through straight
javascript but still is not working the way that I would hope.
Basically I have the following in my application.js
var Myapp = {
myObserver: function(event) {
// links to adding a new
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
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);
2012 Feb 29
4
how to use link_to with :remote=>true in rails 3.2.1
I m using Rails 3.2.1. how to use link_to with remote=>true
--------------------------------------------
My Method in Controller
def clickme
@clk = "you click me"
respond_to do |format|
format.js { render :layout=>false }
end
end
--------------------------------------------
My View
In my new.html.erb file
<%= link_to "click here",