new PagingFactory()

A factory for paging types allowing them to be easily registered and created.

Description

The plugin makes use of an instance of this class exposed as FooGallery.paging.

Details

FooGallery.Factory

Members


<readonly> registered :Object.<string, Object>

An object containing all registered paging types.

Examples

The following shows the structure of this object. The <name> placeholders would be the name the class was registered with.


{
	"<name>": {
		"name": <string>,
		"klass": <function>,
		"ctrl": <function>,
		"priority": <number>
	},
	"<name>": {
		"name": <string>,
		"klass": <function>,
		"ctrl": <function>,
		"priority": <number>
	},
	...
}
Details
Object.<string, Object>

Methods


register( name, type [, ctrl [, options [, classes [, il8n [, priority ] ] ] ] ] ) → {boolean}

Registers a paging type constructor with the factory using the given name and test function.

Parameters
Name Type Attributes Default Description
name string

The friendly name of the class.

type FooGallery.Paging

The paging type constructor to register.

ctrl FooGallery.PagingControl <optional>

An optional control to register for the paging type.

options object <optional>
{}

The default options for the paging type.

classes object <optional>
{}

The CSS classes for the paging type.

il8n object <optional>
{}

The il8n strings for the paging type.

priority number <optional>
0

This determines the index for the class when using either the load or names methods, a higher value equals a lower index.

Returns

true if the klass was successfully registered.


hasCtrl( name ) → {boolean}

Checks if the factory contains a control registered using the supplied name.

Parameters
Name Type Description
name string

The friendly name of the class.

Returns

makeCtrl( name, template, parent, position ) → {FooGallery.PagingControl}

Create a new instance of a control class registered with the supplied name and arguments.

Parameters
Name Type Description
name string

The friendly name of the class.

template FooGallery.Template

The template creating the control.

parent FooGallery.Paging

The parent paging class creating the control.

position string

The position the control will be displayed at.

Returns