EnsPortal.Util.RuleSVGCommon
abstract class EnsPortal.Util.RuleSVGCommon
Abstract class to contain functionality common to the three portal pages used in editing rules, EnsPortal.RuleEditor, EnsPortal.ConstraintEditor and EnsPortal.ExpressionEditor. The methods in this class are intended for reuse across all three pages.Method Inventory
Methods
clientmethod addClickHandler(el, handlerMethodName) [ Language = javascript ]
Method to correctly add a click handler to the element in el. handlerMethodname specifies
the method of zenPage to invoke when a click or double click occurs. The specified method is expected to accept
two arguments, the event and then a boolean flag to indicate whether the click was a double-click or not.
The code to determine whether the click is a double-click is moved to the actual click code as it is very
browser-dependent as to whether the browser:
- supports the ondblclick event handler for the target element,
- accurately reports the number of clicks in event.detail, or
- supports the use of anonymous functions in event handler assignments.
clientmethod updateBrowserFlags() [ Language = javascript ]
Helper method to work out whether the browser is IE10 or newer.
The addClickHandler()() relies on this information to determine how
click events should be handled by the browser.