OTRS API Reference JavaScript

Namespace: Core.UI

Core. UI

This namespace contains all UI functions.
Author:
  • OTRS AG
Source:

Namespaces

Accessibility
Accordion
ActionRow
AdvancedChart
AllocationList
Autocomplete
Datepicker
Dialog
DnD
Floater
InputFields
Notification
Popup
Resizable
RichTextEditor
Table
TreeSelection

Methods

(static) Animate($Element, Type)

Animate an element on demand using a css-based animation of the given type
Parameters:
Name Type Description
$Element jQueryObject The element to animate.
Type String The animation type as defined in Core.Animations.css, e.g. 'Shake'
Source:

(static) GetID($Element) → {String}

Returns the ID of the Element and creates one for it if nessessary.
Parameters:
Name Type Description
$Element jQueryObject The HTML element
Source:
Returns:
ID of the element
Type
String

(static) HideNotification(Text, Type, Callback) → {Boolean}

Hides a certain notification.
Parameters:
Name Type Description
Text String the text by which the notification can be recognized (untranslated).
Type String Error|Notice
Callback function function which should be executed once the notification was hidden
Source:
Returns:
true or false depending on if the notification could be removed or not
Type
Boolean

(static) Init()

Initializes the namespace.
Source:

(static) InitAjaxDnDUpload()

Init drag & drop ajax upload on relevant input fields of type "file"
Source:

(static) InitCheckboxSelection($Element)

This function initializes a click event for tables / divs with checkboxes. If you click in the table cell / div around the checkbox the checkbox will be selected. A possible MasterAction will not be executed.
Parameters:
Name Type Description
$Element jQueryObject The element selector which describes the element(s) which surround the checkboxes.
Source:

(static) InitMasterAction()

Extend click event to the whole table row.
Source:

(static) InitMessageBoxClose()

This function initializes the close buttons for the message boxes that show server messages.
Source:

(static) InitStickyWidget($Element, Type)

Animate an element on demand using a css-based animation of the given type
Parameters:
Name Type Description
$Element jQueryObject The element to animate.
Type String The animation type as defined in Core.Animations.css, e.g. 'Shake'
Source:

(static) InitWidgetActionToggle()

This function initializes the toggle mechanism for all widgets with a WidgetAction toggle icon.
Source:

(static) InitWidgetTabs()

Initializes tab functions (e.g. link navigation) on widgets with class 'Tabs'.
Source:

(static) RegisterToggleTwoContainer($ClickedElement, $Element1, $Element2)

Registers click event to toggle the container.
Parameters:
Name Type Description
$ClickedElement jQueryObject
$Element1 jQueryObject First container element.
$Element2 jQueryObject Second container element.
Source:

(static) ScrollTo($Element)

Scrolls the active window until an element is visible.
Parameters:
Name Type Description
$Element jQueryObject
Source:

(static) ShowNotification(Text, Type, Link, Callback, ID, Icon) → {Boolean}

Displays a notification on top of the page.
Parameters:
Name Type Description
Text String the text which should be shown in the notification (untranslated)
Type String Error|Notice (default)
Link String the (internal) URL to which the notification text should point
Callback function function which should be executed once the notification was hidden
ID String The id for the newly created notification (default: no ID)
Icon String Class of a fontawesome icon which will be added before the text (optional)
Source:
Returns:
true or false depending on if the notification could be shown or not
Type
Boolean

(static) ToggleTwoContainer($Element1, $Element2)

This functions toggles two Containers with a nice slide effect.
Parameters:
Name Type Description
$Element1 jQueryObject First container element.
$Element2 jQueryObject Second container element.
Source:

(static) WidgetOverlayHide($Widget, Switch)

This function removes an overlay from a given widget
Parameters:
Name Type Description
$Widget jQueryObject Widget element
Switch Boolean Whether the overlay should show a success icon before being removed
Source:

(static) WidgetOverlayShow($Widget, Type)

This function covers a given widget with an overlay
Parameters:
Name Type Description
$Widget jQueryObject Widget element
Type String type of icon which should be displayed (currently only 'Loading' is possible)
Source: