You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by jo...@apache.org on 2011/07/14 19:32:55 UTC
svn commit: r1146813 -
/shindig/trunk/features/src/main/javascript/features/shindig.random/random.js
Author: johnh
Date: Thu Jul 14 17:32:54 2011
New Revision: 1146813
URL: http://svn.apache.org/viewvc?rev=1146813&view=rev
Log:
Fix onmousemove handling when shindig.random is used.
Modified:
shindig/trunk/features/src/main/javascript/features/shindig.random/random.js
Modified: shindig/trunk/features/src/main/javascript/features/shindig.random/random.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/shindig.random/random.js?rev=1146813&r1=1146812&r2=1146813&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/shindig.random/random.js (original)
+++ shindig/trunk/features/src/main/javascript/features/shindig.random/random.js Thu Jul 14 17:32:54 2011
@@ -34,7 +34,9 @@ shindig.random = (function() {
var hex = '0123456789ABCDEF';
var start = 1;
var m = ((screen.width * screen.width) + screen.height) * 1e6;
+ var sliceFn = [].slice;
+ // TODO: consider using addEventListener
var orig_onmousemove = window.onmousemove || function() { };
window.onmousemove = function(e) {
@@ -46,7 +48,7 @@ shindig.random = (function() {
ac += (e.screenY + e.clientY);
ac *= new Date().getTime() % 1e6;
start = (start * ac) % m;
- return orig_onmousemove.call(window, Array.prototype.slice.call(arguments));
+ return orig_onmousemove.apply(window, sliceFn.call(arguments, 0));
};
function sha1(str) {