Home Reference Source
public class | source

Elements

Extends:

Queueable → Elements

Example:

elements.removeClass({"targetId":".leftPanel","class":"hidden"});

Member Summary

Public Members
public

drags: {}

Method Summary

Public Methods
public

addClass(pid: number, json: object)

Add a class to a dom element

public

Accessible toggle visible on a target

public

domCutPaste(pid: number, json: object)

Cut a dom element out and paste it somewhere

public

Delete element from dom

public

dragBoundsUpdate - Reset the boundary area manually

public

dragMoveIntoBounds - Force a drag back into bounds

public

dragOn(pid: number, json: object)

dragOn - Make an element dragable

public

dragReset(pid: number, json: object)

dragReset - Reset the drag item

public

focus(pid: number, json: object)

Focus on a target

public

Monitor element(s) in a form and add classes on change

public

Monitor element(s) in a form and validate

public

Get the values from checked input boxes

public

Get the computed style for an element

public

getMultiselectValues(pid: *, json: *)

public

innerHTML(pid: number, json: object)

Set the HTML of an element

public

removeClass(pid: number, json: object)

Remove a class to a dom element

public

Scroll a dom container target to a dom target

public

Scroll to a dom target

public

Scroll to bottom of a dom target

public

scrollTop(pid: number, json: object)

Scroll a dom container to the top

public

setAttribute(pid: number, json: object)

Set attribute of a dom element

public

setInputValue(pid: number, json: object)

Set the value of an input field

public

setStyle(pid: number, json: object)

Set style of a dom element

public

toggleClass(pid: number, json: object)

toggle a class on a dom element

Inherited Summary

From class Queueable
public

queue: *

public
public

finished(pid: *, mode: *)

Call this method after you command has finished.

public

init(queue: *)

init, override this for any promise based inits setting the self.ready=true after the promise

public

set(pid: *, value: *)

public

start(pid: *, command: *, json: *)

Called from queue, starts running the actual command

Public Members

public drags: {} source

Public Methods

public addClass(pid: number, json: object) source

Add a class to a dom element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.iframeId string

iframe target

json.targetId string

Dom target

json.class string

Name of class to add

Example:

elements.addClass({"targetId":".leftPanel","class":"hidden"});

public ariaHiddenToggle(pid: number, json: object) source

Accessible toggle visible on a target

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target to scroll to*

json.mode string

toggle|add|remove

Example:

elements.focus({"targetId":"#ps_1"});

public domCutPaste(pid: number, json: object) source

Cut a dom element out and paste it somewhere

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

json.sourceId string

Source dom element

Example:

elements.domCutPaste({"targetId":".leftPanel","sourceId":".thing"});

public domRemoveElement(pid: number, json: object) source

Delete element from dom

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target to removce

Example:

elements.domRemoveElement({"targetId":".leftPanel"});

public dragBoundsUpdate(pid: number, json: object) source

dragBoundsUpdate - Reset the boundary area manually

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.drag string

the drag item to reset

Example:

-elements.dragBoundsUpdate({"drag":"mydraf"});

public dragMoveIntoBounds(pid: number, json: object) source

dragMoveIntoBounds - Force a drag back into bounds

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.drag string

the drag item to reset

Example:

-elements.dragBoundsUpdate({"drag":"mydraf"});

public dragOn(pid: number, json: object) source

dragOn - Make an element dragable

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.drag string

the drag item to use

json.targetId string

element to be dragable

json.dragTargetId string

element to be the area you can actually drag

json.bounds string

element to be the area you cant drag out of

json.buffer int

the amount of buffer in pixels to apply to the boundary

Example:

-elements.dragOn({"targetId":"#functionDragAnalyticsTop","dragTargetId":"#functionDragAnalyticsTop .dragbar","drag":"analytics","bounds":".edit-scenario-map"});

public dragReset(pid: number, json: object) source

dragReset - Reset the drag item

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.drag string

the drag item to reset

Example:

-elements.dragReset({"drag":"mydraf"});

public focus(pid: number, json: object) source

Focus on a target

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target to scroll to*

Example:

elements.focus({"targetId":"#ps_1"});

public formActivityMonitor(pid: number, json: object) source

Monitor element(s) in a form and add classes on change

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

elements(s) to monitor for change and add modifiedClass to

json.buttonId string

Element to add modifiedClass to

json.modifiedClass string

Class to add to modified elements

json.modifiedQueue string

Prepared queue to run when element modified

Example:

elements.formActivityMonitor({"targetId":".functionMonitor","buttonId":".form-save","modifiedClass":"modified"});

public formValidityMonitor(pid: number, json: object) source

Monitor element(s) in a form and validate

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

elements(s) to monitor for change and add modifiedClass to

json.buttonId string

Element to add modifiedClass to

json.focusClass string

Class to add to focuses elements

json.validClass string

Prepared queue to run when element modified

json.errorClass string

Prepared queue to run when element modified

json.timeout string

Length of time after user has finished typing to update

Example:

elements.formValidityMonitor({"targetId":".functionMonitor","buttonId":".submit-form","validClass":"valid","focusClass":"focus","errorClass":"error"},{"queueRun":"Instant"});

public getCheckBoxValues(pid: number, json: object) source

Get the values from checked input boxes

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target for check boxes

json.mode string

array|string

json.separator string

What seperator to use in string mode

json.name string

Name of the memory element to set

Example:

elements.getCheckBoxValues({"mode":"string","targetId":".functionGetTypes"});

public getComputedStyle(pid: number, json: object) source

Get the computed style for an element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

json.styles string

value to get

json.name string

memory name to use

Example:

elements.getComputedStyle({"targetId":"#username","styles":"background"});

public getMultiselectValues(pid: *, json: *) source

Params:

NameTypeAttributeDescription
pid *
json *

public innerHTML(pid: number, json: object) source

Set the HTML of an element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

json.html string

HTML to add

json.append string

Append mode

Example:

elements.innerHTML({"targetId":".leftPanel","html":"Hello World"});

public removeClass(pid: number, json: object) source

Remove a class to a dom element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.iframeId string

iframe target

json.targetId string

Dom target

json.class string

Name of class to remove

Example:

elements.removeClass({"targetId":".leftPanel","class":"hidden"});

public scrollContainerToElement(pid: number, json: object) source

Scroll a dom container target to a dom target

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target to scroll to

json.containerId string

Dom target container to scroll

Example:

elements.scrollIntoView({"containerId":".map-elements-list","targetId":"#ps_1"});

public scrollIntoView(pid: number, json: object) source

Scroll to a dom target

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

Example:

elements.scrollIntoView({"targetId":"#ps_1"});

public scrollToBottom(pid: number, json: object) source

Scroll to bottom of a dom target

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

Example:

elements.scrollToBottom({"targetId":"#ps_1"});

public scrollTop(pid: number, json: object) source

Scroll a dom container to the top

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target to scroll to

Example:

elements.scrollTop({"targetId":".map-elements-list"});

public setAttribute(pid: number, json: object) source

Set attribute of a dom element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.iframeId string

iframe target

json.targetId string

Dom target

json.attribute array

Attribute to set

json.value array

Value to set

Example:

elements.setAttribute({"targetId":".leftPanel","attribute":"src","value":"http://foo/bar.png"});

public setInputValue(pid: number, json: object) source

Set the value of an input field

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

json.value string

value to set

Example:

elements.setInputValue({"targetId":"#username","value":"Hello World"});

public setStyle(pid: number, json: object) source

Set style of a dom element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.iframeId string

iframe target

json.targetId string

Dom target

json.style array

style array of elements in format [{"name":"background","value":"red"}]

Example:

elements.setStyle({"targetId":".leftPanel","style":[{"name":"background","value":"red"}]});

public toggleClass(pid: number, json: object) source

toggle a class on a dom element

Params:

NameTypeAttributeDescription
pid number

Process ID

json object

queue arguments

json.targetId string

Dom target

json.class string

Name of class to toggle

Example:

elements.toggleClass({"targetId":".leftPanel","class":"hidden"});