src/js/utils.js
branchpopcorn-port
changeset 253 95c6b77f005e
parent 252 fd84e0fb26d8
child 254 cafaa694b709
--- a/src/js/utils.js	Wed Nov 16 11:20:52 2011 +0100
+++ b/src/js/utils.js	Wed Nov 16 11:40:57 2011 +0100
@@ -17,15 +17,17 @@
    a closure. This way, the 
 */   
 IriSP.wrap = function (obj, fn) {
-  return function() {
-    var args = [].slice.call(this, arguments);
-    return fn.call(obj, args);
+  return function() {    
+    var args = Array.prototype.slice.call(arguments, 0);
+    return fn.apply(obj, args);
   }
 }
 
 /* convert a time to a percentage in the media */
 IriSP.timeToPourcent = function(time, timetotal){
-	// return (parseInt(Math.round(time/timetotal*100)));
+	var time = Math.abs(time);
+  var timetotal = Math.abs(timetotal);
+  
 	return Math.floor((time/timetotal) * 100);
 };