Skip to content

Commit 308a957

Browse files
author
shengyonggen
committed
修复i声明问题
1 parent 817b174 commit 308a957

File tree

5 files changed

+52
-8
lines changed

5 files changed

+52
-8
lines changed

sensorsdata.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sdk.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ _.encodeDates = function(obj) {
253253
_.hashCode = function(str){
254254
var hash = 0;
255255
if (str.length == 0) return hash;
256-
for (i = 0; i < str.length; i++) {
256+
for (var i = 0; i < str.length; i++) {
257257
char = str.charCodeAt(i);
258258
hash = ((hash<<5)-hash)+char;
259259
hash = hash & hash;
@@ -748,6 +748,7 @@ _.addEvent = function() {
748748
if (event) {
749749
event.preventDefault = fixEvent.preventDefault;
750750
event.stopPropagation = fixEvent.stopPropagation;
751+
//event.path = fixEvent.path;
751752
}
752753
return event;
753754
}
@@ -758,6 +759,27 @@ _.addEvent = function() {
758759
fixEvent.stopPropagation = function() {
759760
this.cancelBubble = true;
760761
};
762+
fixEvent.path1 = function() {
763+
try{
764+
var polyfill = function () {
765+
var element = this.target;
766+
var pathArr = [element];
767+
if (element === null || element.parentElement === null) {
768+
return [];
769+
}
770+
while (element.parentElement !== null) {
771+
element = element.parentElement;
772+
pathArr.unshift(element);
773+
}
774+
return pathArr;
775+
};
776+
return this.path || (this.composedPath && this.composedPath()) || polyfill();
777+
}catch(e){
778+
return [];
779+
}
780+
};
781+
782+
761783
register_event.apply(null,arguments);
762784
};
763785

src/sensorsdata.full.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ _.encodeDates = function(obj) {
371371
_.hashCode = function(str){
372372
var hash = 0;
373373
if (str.length == 0) return hash;
374-
for (i = 0; i < str.length; i++) {
374+
for (var i = 0; i < str.length; i++) {
375375
char = str.charCodeAt(i);
376376
hash = ((hash<<5)-hash)+char;
377377
hash = hash & hash;
@@ -866,6 +866,7 @@ _.addEvent = function() {
866866
if (event) {
867867
event.preventDefault = fixEvent.preventDefault;
868868
event.stopPropagation = fixEvent.stopPropagation;
869+
//event.path = fixEvent.path;
869870
}
870871
return event;
871872
}
@@ -876,6 +877,27 @@ _.addEvent = function() {
876877
fixEvent.stopPropagation = function() {
877878
this.cancelBubble = true;
878879
};
880+
fixEvent.path1 = function() {
881+
try{
882+
var polyfill = function () {
883+
var element = this.target;
884+
var pathArr = [element];
885+
if (element === null || element.parentElement === null) {
886+
return [];
887+
}
888+
while (element.parentElement !== null) {
889+
element = element.parentElement;
890+
pathArr.unshift(element);
891+
}
892+
return pathArr;
893+
};
894+
return this.path || (this.composedPath && this.composedPath()) || polyfill();
895+
}catch(e){
896+
return [];
897+
}
898+
};
899+
900+
879901
register_event.apply(null,arguments);
880902
};
881903

version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
var sensorsdata_js_sdk_latest_version = '1.7.1.2';
1+
var sensorsdata_js_sdk_latest_version = '1.8.1.3';
22
var sensorsdata_js_sdk_noupdate_version = 'latest1';

vtrack.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)