cordova - Initialising fastclick with requirejs -
i use requirejs fastclick. following error:
uncaught typeerror: cannot set property 'trackingclick' of undefined in fastclick.js line 30 does: this.trackingclick = false;
in config.js run app.js:
require.config({ paths: { fastclick:'fastclick' } )}; require(['app'], function (app) { app.initialize(); }); in app.js do:
define(['fastclick'], function(fastclick){ var app = { initialize: function () { var attachfastclick = require('fastclick'); attachfastclick(document.body); } } return app; } the browser starts fine , in debugger fastclick library instantiated , resolved still this in fastclick.js cannot resolved.
i tried fastclick(document.body); did not seem have effect.
any ideas?
looking through fastclick code found following functions works: fastclick.attach
so, instead of calling:
var attachfastclick = require('fastclick'); attachfastclick(document.body); the following works:
fastclick.attach(document.body);
Comments
Post a Comment