new Breakpoints(table) → {FooTable.Breakpoints}
Contains the logic to calculate and apply breakpoints for the plugin.
Parameters:
Name | Type | Description |
---|---|---|
table |
FooTable.Table | The parent FooTable.Table this component belongs to. |
Returns:
- Type
- FooTable.Breakpoints
Extends
Members
(private) _classNames :string
This value is set once when the
FooTable.Breakpoints#array
is generated and contains a space delimited string of all the breakpoint class names.
Type:
- string
array :Array.<FooTable.Breakpoint>
An array of
FooTable.Breakpoint
objects created from parsing the options.
Type:
- Array.<FooTable.Breakpoint>
cascade :boolean
Whether or not breakpoints cascade. When set to true all breakpoints larger than the current will be hidden along with it.
Type:
- boolean
current :FooTable.Breakpoint
The current breakpoint.
Type:
(protected) destroy
This method is called from the
FooTable.Table#destroy
method.
- Inherited From:
enabled :boolean
Whether or not this component is enabled. Disabled components only have there preinit method called allowing for this value to be overridden.
Type:
- boolean
- Inherited From:
ft :FooTable.Table
The parent
FooTable.Table
for the component.
Type:
- Inherited From:
hidden :string
This value is updated each time the current breakpoint changes and contains a space delimited string of the names of the current breakpoint and all those smaller than it.
Type:
- string
(protected) o :FooTable.Table#options
This provides a shortcut to the
FooTable.Table#options
object.
Type:
- FooTable.Table#options
useParentWidth :boolean
Whether or not to calculate breakpoints on the width of the parent element rather than the viewport.
Type:
- boolean
Methods
(static) visible(breakpoints) → {boolean}
Supplied a columns breakpoints this returns a boolean value indicating whether or not the column is visible.
Parameters:
Name | Type | Description |
---|---|---|
breakpoints |
string | A space separated string of breakpoint names. |
Returns:
- Type
- boolean
calculate() → {FooTable.Breakpoint}
Calculates the current breakpoint from the
FooTable.Breakpoints#array
and sets the FooTable.Breakpoints#current
property.
Returns:
- Type
- FooTable.Breakpoint
check()
Performs a check between the current breakpoint and the previous breakpoint and performs a redraw if they differ.
Fires:
(protected) draw()
Whenever the table is drawn this ensures the correct breakpoint class is applied to the table.
- Overrides:
get(breakpointopt) → {FooTable.Breakpoint}
Attempts to return a
FooTable.Breakpoint
instance when passed a FooTable.Breakpoint
,
the FooTable.Breakpoint#name
string or if nothing is supplied the current breakpoint.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
breakpoint |
FooTable.Breakpoint | string | number |
<optional> |
The breakpoint to retrieve. |
Returns:
- Type
- FooTable.Breakpoint
getParentWidth() → {number}
Gets the tables direct parents width.
Returns:
- Type
- number
getViewportWidth() → {number}
Gets the current viewport width.
Returns:
- Type
- number
getWidth() → {number}
Gets the width used to determine breakpoints whether it be from the viewport, parent or a custom function.
Returns:
- Type
- number
(protected) init()
Initializes the class parsing the options into a sorted array of
FooTable.Breakpoint
objects.
- Overrides:
Fires:
(protected) postdraw()
This method is called from the
FooTable.Table#draw
method.
- Inherited From:
(protected) predraw()
This method is called from the
FooTable.Table#draw
method.
- Inherited From:
(protected) preinit(data)
Checks the supplied data and options for the breakpoints component.
Parameters:
Name | Type | Description |
---|---|---|
data |
object | The jQuery data object from the parent table. |
- Overrides: