Home Reference Source
import {ComposedControl} from 'guide4you/src/controls/ComposedControl.js'
public class | source

ComposedControl

Extends:

Control → ComposedControl

Indirect Subclass:

MobileControls

This is a class ComposedControl which provides some functionality for controls which are composed out of several other controls. It makes use of the composite pattern.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
Private Members
private

$container_: jQuery

private
private
private
private

Method Summary

Public Methods
public

addControl(control: Control, options: Object)

public

used by positioning

public
public

get$Container(): jQuery

public
public

isSqueezable(dimension: string): boolean

Returns true if the control is squeezable in the given dimension.

public

release(dimension: string)

Removes the squeeze.

public

removeControl(control: Control, propagate: boolean)

public

setMap(map: G4UMap)

public

squeezeBy(dimension: string, value: number): number

Squeezes the control in the given dimension by the provided value.

public
Private Methods
private

addClasses_($item: jQuery): jQuery

This method adds some helping css classes to the items

Public Constructors

public constructor(options: ComposedControlOptions) source

Params:

NameTypeAttributeDescription
options ComposedControlOptions
  • optional
  • default: {}

Public Members

public minHeight_: * source

public scrolled_: * source

public squeeze_: * source

Private Members

private $container_: jQuery source

private classNameItemFirst_: string source

private classNameItemLast_: string source

private classNameItem_: string source

private controls_: Control[] source

Public Methods

public addControl(control: Control, options: Object) source

Params:

NameTypeAttributeDescription
control Control
options Object
options.claim Boolean
  • optional
  • default: true

if claim is set to false the control won't add anything to the container

options.wrap Boolean
  • optional
  • default: true

if wrap is set to true a span will be put arround the element if set to false the element of the control will be inserted directly

options.cssPosition Boolean
  • optional
  • default: true

if this is set to true the wrap or the element will get css classes indicating its position inside the container

options.element HTMLElement
  • optional

if this is set it will be put inside the container instead calling control.set$Target()

public afterPositioning() source

used by positioning

public beforePositioning() source

public get$Container(): jQuery source

Return:

jQuery

public getControls(): Control[] source

Return:

Control[]

public isSqueezable(dimension: string): boolean source

Returns true if the control is squeezable in the given dimension. Used by Positioning.

Params:

NameTypeAttributeDescription
dimension string

Return:

boolean

public release(dimension: string) source

Removes the squeeze. Used by Positioning.

Params:

NameTypeAttributeDescription
dimension string

public removeControl(control: Control, propagate: boolean) source

Params:

NameTypeAttributeDescription
control Control
propagate boolean
  • optional
  • default: true

propagate to map

public setMap(map: G4UMap) source

Params:

NameTypeAttributeDescription
map G4UMap

public squeezeBy(dimension: string, value: number): number source

Squeezes the control in the given dimension by the provided value. Used by Positioning Returns the value the control could get squeezed by.

Params:

NameTypeAttributeDescription
dimension string
value number

Return:

number

public updateVisibility() source

Private Methods

private addClasses_($item: jQuery): jQuery source

This method adds some helping css classes to the items

Params:

NameTypeAttributeDescription
$item jQuery

Return:

jQuery