Handling click binding in the _onResize seems to be costly. That logic would bind the listeners about 50 times a second. Currently, the events stay bound, but after a click event, it checks to see if it has to do anything in terms of showing hidden data.


From: Austin Morris <notifications@github.com<mailto:notifications@github.com>>
Reply-To: griddly-bear/griddly-bear <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Tuesday, August 20, 2013 3:57 PM
To: griddly-bear/griddly-bear <griddly-bear@noreply.github.com<mailto:griddly-bear@noreply.github.com>>
Cc: Brandon Freeman <bfreeman@ussignalcom.com<mailto:bfreeman@ussignalcom.com>>
Subject: Re: [griddly-bear] Grrresponsive (#17)


In js/griddly-bear.js:

>              self._drawRows(data);
> +            self._onResize();
> +            self._createTouchEvents();


Because whether or not the event handlers should be attached should be determined by the current grid view (e.g. no touch events when full expanded because we can already see the data). That is determined in _onResize.

—
Reply to this email directly or view it on GitHub<https://github.com/griddly-bear/griddly-bear/pull/17/files#r5879119>.