Class: UWA.Controls.Input.Button

UWA/Controls/Input. UWA.Controls.Input.Button

new UWA.Controls.Input.Button()

Represents a button. Inherits from Input.

Available CSS Classes

The className option can be composed of one or more of those CSS classes:

Themes:

Class name Description
green Green button
black Black button
light-grey Light grey button
medium-grey Medium grey button
dark-grey Dark grey flat button
extra-dark-grey Very dark grey flat button
border-only Border only button with a transparent background
light-border-only Border only button with a transparent background, suited displaying on dark backgrounds

Sizes:

Class name Description
small Height 24px
medium Height 32px
large Height 54px

Icon orientation:

Class name Description
iconr Add an icon to the right
iconl Add an icon to the left
icon-only Icon only. Button without text
icon-separated The icon will be displayed over a dark background

Icons:

Class name Description
refresh Refresh icon
delete Delete icon
plus Plus icon
next Next arrow icon
previous Previous arrow icon
cogwheel cogwheel icon
play Play icon
download Download icon

Extends

Index

Members

<protected> name

Properties:
Name Type Description
name String

The input name. Default: 'uwa-text'.

<protected> options

Properties:
Name Type Description
options Object

The default controls options.

<protected> elements :Object

The current control elements.

Type
  • Object
Inherited From:

Methods

<protected> buildSkeleton()

Build main dom elements.

Inherited From:

syncInput()

Synchronize the control display with the native input state. To override.

Inherited From:

focus(y, changeInputFocus) → {this}

Set the focus on this input.

Parameters
Name Type Argument Default Description
y Boolean <optional>
true

If false, removes the focus.

changeInputFocus Boolean <optional>
true

change the input focus (you should not change that)

Returns

instance

Type
this
Inherited From:

isDisabled() → {Boolean}

Get if this input is disabled

Returns
Type
Boolean
Inherited From:

setDisabled(y) → {this}

Set the input as disabled

Parameters
Name Type Argument Default Description
y Boolean <optional>
true

If false, enable the input.

Returns
Type
this
Inherited From:

getValue() → {String}

Get the input value. To override if needed.

Returns

The input value

Type
String
Inherited From:

setValue(value) → {this}

Set the input value. To override if needed.

Parameters
Name Type Description
value String

The new value

Returns
Type
this
Inherited From:

getContent() → {HTMLelement}

Returns control content.

Returns

Control container.

Type
HTMLelement
Inherited From:

getInputElement() → {HTMLelement}

Returns the native input element

Returns
Type
HTMLelement
Inherited From:

inject(element, where) → {this}

Inject control in the dom.

Parameters
Name Type Argument Description
element HTMLelement

Dom target

where String <optional>

Where to inject

Returns
Type
this
Inherited From:

remove() → {this}

Remove the control from the dom

Returns
Type
this
Inherited From:

getClassNames(suffixes) → {String}

Generate a CSS class name based on the class name property, its parent classes, and the options "className". It should be used internally (in the control).

Example
var Input = UWA.Controls.Abstract.extend({
   name: 'uwa-input',

   options: {
       className: '',
   },

   buildSkeleton: function () {
       this.elements.container = UWA.createElement('div', { 'class': this.getClassNames() });
       this.elements.content = UWA.createElement('div', { 'class': this.getClassNames('-content') });
   }
});

var Radio = Input.extend({
   name: 'uwa-inputradio'
});

new Radio({
    className: 'toto black'
});
// container will have the class 'toto black uwa-inputradio uwa-input'
// content will have the class 'toto black uwa-inputradio-content uwa-input-content'
Parameters
Name Type Description
suffixes String

All parameters should be strings, used as suffix to append to the UWA.Class names of the inheritance chain.

Returns

The generated CSS class name.

Type
String
Inherited From:

hide()

Hide control content.

Inherited From:

show()

Show control content.

Inherited From:

destroy()

Destroy the control elements and its children. Remove all events and remove the element from the dom. This control and its children should not be used after this.

Inherited From: