The two events were being emitted (touchstart + click 400ms after) which on
some devices was causing the toggle to expand then immediately collapse.
Best solution I could think of was to use a single event, but pick the
fastest one.


On 4 March 2013 09:46, Patrick Hamann <notifications@github.com> wrote:

> In common/app/assets/javascripts/bootstraps/story.js:
>
> > @@ -26,11 +26,12 @@ define([
> >          },
> >
> >          initTimeline: function() {
> > -            var timeline = document.querySelector('.timeline');
> > +            var timeline = document.querySelector('.timeline'),
> > +                eventType = 'ontouchstart' in document.documentElement ? 'touchstart' : 'click';
>
> What was the reasoning behind this?
>
> What about devices that support both? Such as the Microsoft Surface or
> Chromebook Pixel?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/guardian/frontend/pull/486/files#r3221631>
> .
>

Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - website of the year
 
www.guardian.co.uk    www.observer.co.uk     www.guardiannews.com 
 
On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad 
 
Save up to 32% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access. 
Visit guardian.co.uk/subscribe
 
---------------------------------------------------------------------
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.
 
Guardian News & Media Limited
 
A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP
 
Registered in England Number 908396