ftlabs/fastclick — pull request #270 by jhnns (2014-06-20 12:24:37+00:00)
Title: Wrap whole lib in umd wrapper and remove redundant 'use strict'

This pull-request wraps the whole library in a [umd wrapper](https://github.com/umdjs/umd).

It fixes a problem when fastclick is used with a bundler like [browserify](http://browserify.org/) or [webpack](http://webpack.github.io/) which use `eval()` for source urls.

According to the [documentation on `eval()` in strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode#Simplifying_variable_uses) "strict" code can only access variables defined by `eval()` in the **same** scope. Thus accessing `FastClick` or `deviceIsAndroid` inside of a function (which is preceded by `'use strict';`) triggers a `ReferenceError`.

Hence fastclick doesn't work with browserify or webpack in dev-mode.

The diff looks horrible because I needed to indent the whole lib. Actually I've done these changes:

- Wrap the whole lib in a umd wrapper
- Indent everything by one tab (accoding to your coding rules I guess)
- Added 'use strict' at the beginning
- Removed 'use strict' from every function

This also fixes #231