back to Overview


Exposes a map of prefix handlers used by get.
Web module only.




Exposes a map of prefix handlers used by get(). You can add support for a new prefix in get() by adding a function to this map. The prefix can be any string consisting solely of non-alphanumeric characters that's not already used by Minified.

You must not replace getters by a new map, but must always modify the existing map.

The function's signature is function(list, name) where

Is the Minified list to get the value from. By convention you should always use only the first element. The list is non-empty and the first elememt can't be null or undefined (get() automatically returns undefined in all other case).
The name of the property. That's the part AFTER the prefix.
(callback return value)
The value to return to the user.


Adding a shortcut '||' for accessing border style properties:

MINI.getter['||'] = function(list, name) {
	return list.get('$border' + name.replace(/^[a-z]/, function(a) { return a.toUpperCase()});

var borderColor = $('#box').get('||color'); // same as '$borderColor'
var borderLeftRadius = $('#box').get('||leftRadius'); // same as '$borderLeftRadius'


Adding XLink attribute support to get(). This is useful if you work with SVG. The prefix is '>'.

MINI.getter['>'] = function(list, name) {
	return list[0].getAttributeNS('', name);

var xlinkHref = $('#svgLink').get('>href');


comments powered by Disqus

back to Overview