No, it's to avoid a second lookup when we already have a reference to the
button.


On Tue, Jul 9, 2013 at 9:26 PM, Christopher Van <notifications@github.com>wrote:

> In hearth/media/js/buttons.js:
>
> > +            });
> > +
> > +            // If the purchase or installation fails, revert the button.
> > +            revertButton($this);
> > +        });
> > +
> > +        return def.promise();
> > +    }
> > +
> > +    z.page.on('click', '.product.launch', launchHandler)
> > +          .on('click', '.button.product:not(.launch):not(.incompatible)', _handler(install));
> > +
> > +    function buttonInstalled(manifest_url, installer, $button) {
> > +        // If the button wasn't passed, look it up.
> > +        if (!$button || !$button.length) {
> > +            $button = $('.button[data-manifest_url="' + manifest_url.replace(/"/, '\\"') + '"]');
>
> this is to avoid $('.button[data-manifest-url]').each(function() { if
> ($(this).data('manifest_url') == manifest_url) { ... } });?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/fireplace/pull/221/files#r5107857>
> .
>