nx.ui.nx.dom.Document - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.ui.nx.dom.Document Class

Module: nx.ui

Document Element

## Constructor

### `nx.ui.nx.dom.Document`

()

- Index
- Methods
- Properties

## Item Index

### Methods

- addRule
- addRules
- createElement
- createElementNS
- createFragment
- createText
- deleteRule
- deleteRules
- docRect
- fire
- insertRule
- off
- on
- ready
- registerNS
- removeRule
- resolveNS
- upon
- wrap

### Properties

- body
- cssStyleSheet
- root

## Methods

### `addRule`

(

- `inSelector`
- `inCssText`
- `inIndex`

)

Add a rule to next style sheet

#### Parameters:

- `inSelector` Object
- `inCssText` Object
- `inIndex` Object

#### Returns:

:

### `addRules`

(

- `inRules`

)

Add multi rules

#### Parameters:

- `inRules` Object

### `createElement`

(

- `tag`

)
nx.dom.Element

Create element

#### Parameters:

- `tag` Object

#### Returns:

nx.dom.Element:

### `createElementNS`

(

- `ns`
- `tag`

)
nx.dom.Element

Create element by namespace

#### Parameters:

- `ns` Object
- `tag` Object

#### Returns:

nx.dom.Element:

### `createFragment`

() nx.dom.Fragment

Create document fragment

#### Returns:

nx.dom.Fragment:

### `createText`

(

- `text`

)
nx.dom.Text

Create text node.

#### Parameters:

- `text` Object

#### Returns:

nx.dom.Text:

### `deleteRule`

(

- `inIndex`

)

Delete a rule from next style sheet at last line

#### Parameters:

- `inIndex` Object

#### Returns:

:

### `deleteRules`

()

Delete all rules

### `docRect`

() Width: (Function | Number), height: (Function | Number), scrollWidth: , scrollHeight: *, scrollX: *, scrollY: *

Get document position information

#### Returns:

Width: (Function | Number), height: (Function | Number), scrollWidth: , scrollHeight: *, scrollX: *, scrollY: *:

}

### `fire`

(

- `name`
- `[data]`

)

Trigger an event.

#### Parameters:

- `name` String
- `[data]` optional

### `insertRule`

(

- `inFullCssText`
- `inIndex`

)

insert a rule to next style sheet

#### Parameters:

- `inFullCssText` Object
- `inIndex` Object

#### Returns:

:

### `off`

(

- `name`
- `[handler]`
- `[context]`

)

Remove an event handler.

#### Parameters:

- `name` String
- `[handler]` Function optional
- `[context]` Object optional

### `on`

(

- `name`
- `handler`
- `[context]`

)

Add an event handler.

#### Parameters:

- `name` String
- `handler` Function
- `[context]` Object optional

### `ready`

(

- `inHandler`

)

Dom ready

#### Parameters:

- `inHandler` Object

### `registerNS`

(

- `key`
- `value`

)

Register html tag namespace

#### Parameters:

- `key` Object
- `value` Object

### `removeRule`

(

- `inSelector`
- `inIndex`

)

Remove a rule from next style sheet

#### Parameters:

- `inSelector` Object
- `inIndex` Object

#### Returns:

:

### `resolveNS`

(

- `key`

)

Get a tag namespace value

#### Parameters:

- `key` Object

#### Returns:

:

### `upon`

(

- `name`
- `handler`
- `[context]`

)

Add a single event handler.

#### Parameters:

- `name` String
- `handler` Function
- `[context]` Object optional

### `wrap`

(

- `dom`

)

Wrap dom element to next element

#### Parameters:

- `dom` Object

#### Returns:

:

## Properties

### `body`

Object

Get next body element

Default: {}

### `cssStyleSheet`

Object

Get/set next cssStyle sheet

Default: {}

### `root`

Object

Get document root element

Default: {}