GBC 5.01.07 new features and upgrade notes

A summary of new features and changes in functionality introduced with Genero Browser Client (GBC) 5.01.07. Note the changes you may need to make when moving to this version of the GBC.

Important:

This page covers only those new features introduced with the Genero Browser Client version specified in the page title. Check prior new features pages if you migrate from an earlier version.

For a detailed list of GBC 5.01.07 changes, please refer to the list of fixes on our issue tracker.

Previous new features page: GBC 5.01.06 new features and upgrade notes.

Removed theme variables

The following theme variables have been removed:
  • mt-dialog-field-height-ratio
  • gbc-SessionLogPromptWidget-color
  • gbc-SessionLogPromptWidget-z-index
  • gbc-SessionLogPromptWidget-button-height
  • gbc-SessionLogPromptWidget-background-color
  • gbc-SessionEndWidget-message-separator
  • gbc-WaitingWidget-color
  • gbc-WaitingWidget-background-color
  • gbc-UserInterfaceWidget-bars-container-z-index
  • gbc-UserInterfaceWidget-topmenu-z-index
  • gbc-UserInterfaceWidget-background-color
  • gbc-UserInterfaceWidget-separator-color
  • gbc-UserInterfaceWidget-header-color
  • gbc-aui-mutation-watch
  • gbc-aui-json-protocol

gbc-MainContainerWidget-left-dock

The new theme variable $gbc-MainContainerWidget-left-dock specifies which UI component is docked to the left side of the main application window by default.

When $gbc-MainContainerWidget-left-dock is set to sidebardrawer, the application checks the stored settings. If the stored settings have the SidebarDrawer as not docked, the runtime prioritizes the stored settings, ensuring user-defined settings take precedence over the theme settings.

DOMElementHelper

Important:

This release introduces internal changes to DOM handling in the GBC. All previous Element.prototype extensions have been removed and replaced by the new DOMElementHelper class. Please update any JavaScript customizations that rely on these old element methods. Legacy calls no longer work and may cause runtime errors. If you encounter issues upgrading your script, contact your Genero support center for assistance.

In earlier versions of the Genero Browser Client (GBC), DOM manipulation methods were added directly to the native Element.prototype. The new DOMElementHelper class provides a set of static methods for interacting with DOM elements in the GBC. This class improves code readability, simplifies testing and maintenance, and ensures that native DOM prototypes remain untouched.

Use DOMElementHelper only in GBC JavaScript customizations. It is not intended for use in Genero BDL application code.

Use standard DOM event names for parameters like type in DOMElementHelper.on(). For information on the complete list of supported events, go to the MDN Web Doc.

Each method in DOMElementHelper is static and takes the target DOM element as its first argument. For example:
cls.DOMElementHelper.on(element, "click", callback);
Table 1. DOMElementHelper Method Reference
Previous prototype call

New call (DOMElementHelper)

elem.on(type, subFilter, callback) cls.DOMElementHelper.on(elem, type, callback)
elem.off(type) cls.DOMElementHelper.off(elem, type)
elem.getIntAttribute(name) cls.DOMElementHelper.getIntAttribute(elem, name)
elem.domFocus(callback, noScrollContainer) cls.DOMElementHelper.domFocus(elem, preventScroll = false)
elem.hasParentOfType(nodeName) cls.DOMElementHelper.hasParentOfType(elem, nodeName)
elem.setCursorPosition(pos, pos2) cls.DOMElementHelper.setCursorPosition(elem, pos, pos2)
elem.getSelectionText() cls.DOMElementHelper.getSelectionText(elem)
elem.replaceWith(replacement) cls.DOMElementHelper.replaceWith(elem, replacement)
parentElem.prependChild(child) cls.DOMElementHelper.prependChild(parentElem, child)
myElem.insertAt(index, parentNode) cls.DOMElementHelper.insertAt(elem, index, parentNode)
elem.insertAfter(refNode) cls.DOMElementHelper.insertAfter(elem, refNode)
elem.empty() cls.DOMElementHelper.empty(elem)
elem.parent(className) cls.DOMElementHelper.parent(elem, className)
elem.elementOrParent(className) cls.DOMElementHelper.elementOrParent(elem, className)
elem.isElementOrChildOf(refElem) cls.DOMElementHelper.isElementOrChildOf(elem, refElem)
elem.isInDOM() cls.DOMElementHelper.isInDOM(elem)
elem.child(className) cls.DOMElementHelper.child(elem, className)
elem.childTag(tagName) cls.DOMElementHelper.childTag(elem, tagName)
elem.childrenExcept(item) cls.DOMElementHelper.childrenExcept(elem, item)
elem.toggleClass(cssClass1, cssClass2, switcher) cls.DOMElementHelper.toggleClass(elem, cssClass1, cssClass2, switcher)
elem.toggleClasses(condition, whenTrue, whenFalse) cls.DOMElementHelper.toggleClasses(elem, condition, whenTrue, whenFalse)
elem.index() cls.DOMElementHelper.index(elem)
elem.updateAttribute(name, value) cls.DOMElementHelper.updateAttribute(elem, name, value)
elem.updateAriaAttribute(name, value) cls.DOMElementHelper.updateAriaAttribute(elem, name, value)
elem.updateQAAttribute(qualifiedName, value) cls.DOMElementHelper.updateQAAttribute(elem, qualifiedName,value)
elem.onSwipe(context, callback, options) cls.DOMElementHelper.onSwipe(elem, context, callback, options)
elem.offSwipe(context) cls.DOMElementHelper.offSwipe(elem, context)
elem.onLongTouch(context, callback, options) cls.DOMElementHelper.onLongTouch(elem, context, callback, options)
elem.offLongTouch(context) cls.DOMElementHelper.offLongTouch(elem, context)
Table 2. Removed and Replacement/Recommended methods
Removed methods Replacement / recommended DOM native methods
elem.hasClass(cls) elem.classList.contains(cls)
elem.addClass(cls) elem.classList.add(cls)
elem.addClasses(...) elem.classList.add(...args)
elem.removeClass(cls) elem.classList.remove(cls)
elem.removeAllClasses() elem.className = "" or elem.setAttribute('class', '')
elem.allchild(className) elem.getElementsByClassName(className)