Alien-GvaScript

 view release on metacpan or  search on metacpan

lib/Alien/GvaScript/ProtoExtensions.pod  view on Meta::CPAN

  Event.detailedStop(event, toStop);

Browser-independent method to control fine details of
event stopping within event handlers. 
The C<toStop> argument is an object
which may contain the following properties:

=over

=item stopPropagation

if true, the event will not be passed  to further
handlers up the bubbling hierarchy.

=item preventDefault

if true, the default behaviour of the browser
for that event will be cancelled

=back

=head3 stopAll

Just a convenience object, having both properties
above set to true. So 

  Event.detailedStop(event, Event.stopAll);

is equivalent to calling prototype's C<Event.stop(event)>.


=head2 Class extensions

=head3 checkOptions

  this.options = Class.checkOptions(defaultOptions, ctorOptions)

Utility for constructor methods. The first argument is an object
containing a collection of default options (keys and values).
The second argument is a similar object, containing options
given to the constructor. 

If one of the keys in C<ctorOptions> has no corresponding
key in  C<defaultOptions>, an error is generated (because
the constructor does not expect such a key). Otherwise,
the concatenation of both objects is returned (i.e. values
in C<ctorOptions> take precedence over values in 
C<defaultOptions>).

=head2 ASSERT

  ASSERT (cond, msg);

Checks if C<cond> is true, and if not, generates an error 
with message C<msg>.

=head2 CSSPREFIX

  CSSPREFIX ();

Returns value of C<CSS_PREFIX> global variable if found. If not,
default to 'gva'.

This value is used to prefix css classnames of html elements that are
derived in some GvaScript classes.



( run in 0.399 second using v1.01-cache-2.11-cpan-9bca49b1385 )