Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Commit a2b080e

Browse files
committed
Avoid arrow function for IE compatibility
1 parent b5d74f9 commit a2b080e

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/main/webapp/app.directive.gdxAnnoPage.js

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@
117117
case 'underline':
118118
var start = new ps.Point(event.point);
119119
$rootScope.startRow = getStartRow($rootScope.docInfo, start, attrs);
120-
$rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(start.x)
121-
)
122-
;
120+
$rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(function (x) {
121+
return Math.floor(x) > Math.floor(start.x);
122+
});
123123
if ($rootScope.startText.length > 1) {
124124
currentObject = new ps.Path.Line(new ps.Point($rootScope.startText[0], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight), new ps.Point($rootScope.startText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight));
125125
currentObject.strokeColor = 'black';
@@ -134,9 +134,9 @@
134134
case 'strikeout':
135135
var start = new ps.Point(event.point);
136136
$rootScope.startRow = getStartRow($rootScope.docInfo, start, attrs);
137-
$rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(start.x)
138-
)
139-
;
137+
$rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(function (x) {
138+
return Math.floor(x) > Math.floor(start.x);
139+
});
140140
if ($rootScope.startText.length > 1) {
141141
currentObject = new ps.Path.Line(new ps.Point($rootScope.startText[0], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight / 2), new ps.Point($rootScope.startText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight / 2));
142142
currentObject.strokeColor = 'black';
@@ -178,9 +178,9 @@
178178
case 'underline':
179179
if (currentObject) {
180180
var end = new ps.Point(event.point);
181-
var endText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(end.x)
182-
)
183-
;
181+
var endText = $rootScope.startRow[0].characterCoordinates.filter(function (x) {
182+
return Math.floor(x) > Math.floor(end.x);
183+
});
184184
if (endText.length > 1) {
185185
currentObject.add(new ps.Point(endText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight));
186186
}
@@ -192,9 +192,9 @@
192192
case 'strikeout':
193193
if (currentObject) {
194194
var end = new ps.Point(event.point);
195-
var endText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(end.x)
196-
)
197-
;
195+
var endText = $rootScope.startRow[0].characterCoordinates.filter(function (x) {
196+
return Math.floor(x) > Math.floor(end.x);
197+
});
198198
if (endText.length > 1) {
199199
currentObject.add(new ps.Point(endText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight / 2));
200200
}
@@ -483,17 +483,19 @@
483483
function getStartRow(docInfo, start, attrs) {
484484
var startRow = [];
485485
for (var i = 0; i < 30; i++) {
486-
startRow = docInfo.pages[attrs.number].rows.filter(x => Math.floor(x.lineTop) == (Math.floor(start.y) - i )
487-
)
486+
startRow = docInfo.pages[attrs.number].rows.filter(function (x) {
487+
Math.floor(x.lineTop) == (Math.floor(start.y) - i )
488+
}
489+
)
488490
;
489491
if (startRow.length > 0)
490492
return startRow;
491493
}
492494
if (startRow.length == 0)
493495
for (var i = 0; i < 30; i++) {
494-
startRow = docInfo.pages[attrs.number].rows.filter(x => Math.floor(x.lineTop) == (Math.floor(start.y) + i )
495-
)
496-
;
496+
startRow = docInfo.pages[attrs.number].rows.filter(function (x) {
497+
return Math.floor(x.lineTop) == (Math.floor(start.y) + i )
498+
});
497499
if (startRow.length > 0)
498500
return startRow;
499501
}

0 commit comments

Comments
 (0)