From 323d276fa6c0255b8d04ed7f83e65c0447e71446 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 8 Dec 2014 20:38:48 +0000 Subject: [PATCH] Slight performance improvement on rendering elements with many children. --- etemplate/js/et2_core_DOMWidget.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etemplate/js/et2_core_DOMWidget.js b/etemplate/js/et2_core_DOMWidget.js index acc1a9eab2..c57e23fd58 100644 --- a/etemplate/js/et2_core_DOMWidget.js +++ b/etemplate/js/et2_core_DOMWidget.js @@ -298,6 +298,9 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode, var idx = 0; var children = this._parent.getChildren(); + if(children && children.indexOf) return children.indexOf(this); + + egw.debug('warn', 'No Array.indexOf(), falling back to looping. '); for (var i = 0; i < children.length; i++) { if (children[i] == this)