Skip to content

Commit

Permalink
Merge pull request #209 from evanlok/fix-browser-compatibility
Browse files Browse the repository at this point in the history
Remove ES6 code to fix old browser compatibility
  • Loading branch information
dhilt authored Jun 29, 2018
2 parents bad9a73 + 6977fc1 commit 1d6eb1c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/modules/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Adapter {
throw error;
}

Object.assign(adapterOnScope, this.publicContext);
angular.extend(adapterOnScope, this.publicContext);
this.publicContext = adapterOnScope;
}

Expand Down Expand Up @@ -130,7 +130,7 @@ class Adapter {
}
// out-of-buffer case: deletion may affect Paddings
else if(index >= this.buffer.getAbsMinIndex() && index <= this.buffer.getAbsMaxIndex()) {
if(Array.isArray(newItems) && !newItems.length) {
if(angular.isArray(newItems) && !newItems.length) {
this.viewport.removeCacheItem(index, index === this.buffer.minIndex);
if(index === this.buffer.getAbsMinIndex()) {
this.buffer.incrementMinIndex();
Expand All @@ -143,7 +143,7 @@ class Adapter {
}

applyUpdate(wrapper, newItems) {
if (!Array.isArray(newItems)) {
if (!angular.isArray(newItems)) {
return;
}
let position = this.buffer.indexOf(wrapper);
Expand Down Expand Up @@ -200,4 +200,4 @@ class Adapter {

}

export default Adapter;
export default Adapter;
6 changes: 3 additions & 3 deletions src/modules/buffer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function ScrollBuffer(elementRoutines, bufferSize, startIndex) {
const buffer = Object.create(Array.prototype);

Object.assign(buffer, {
angular.extend(buffer, {
size: bufferSize,

reset(startIndex) {
Expand Down Expand Up @@ -67,7 +67,7 @@ export default function ScrollBuffer(elementRoutines, bufferSize, startIndex) {

// removes elements from buffer
remove(arg1, arg2) {
if (Number.isInteger(arg1)) {
if (angular.isNumber(arg1)) {
// removes items from arg1 (including) through arg2 (excluding)
for (let i = arg1; i < arg2; i++) {
elementRoutines.removeElement(buffer[i]);
Expand Down Expand Up @@ -151,4 +151,4 @@ export default function ScrollBuffer(elementRoutines, bufferSize, startIndex) {
buffer.reset(startIndex);

return buffer;
}
}
2 changes: 1 addition & 1 deletion src/modules/jqLiteExtras.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class JQLiteExtras {
var self;
self = this;
if (typeof value !== 'undefined') {
if (Number.isInteger(value)) {
if (angular.isNumber(value)) {
value = value + 'px';
}
return css.call(self, 'height', value);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Viewport(elementRoutines, buffer, element, viewportContr
return viewport.outerHeight() * padding; // some extra space to initiate preload
}

Object.assign(viewport, {
angular.extend(viewport, {
getScope() {
return scope;
},
Expand Down
4 changes: 2 additions & 2 deletions src/ui-scroll-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ angular.module('ui.scroll.grid', [])
// controller api methods

this.applyLayout = function(layout) {
this.css = Object.assign({}, layout.css);
this.css = angular.extend({}, layout.css);
this.mapTo = layout.mapTo;
applyCss(this.header, this.css);
};
Expand Down Expand Up @@ -158,7 +158,7 @@ angular.module('ui.scroll.grid', [])
let result = [];
columns.forEach((column, index) => result.push({
index: index,
css: Object.assign({}, column.css),
css: angular.extend({}, column.css),
mapTo: column.mapTo
}));
return result;
Expand Down
6 changes: 3 additions & 3 deletions src/ui-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ angular.module('ui.scroll', [])
function persistDatasourceIndex(datasource, propName) {
let getter;
// need to postpone min/maxIndexUser processing if the view is empty
if(Number.isInteger(datasource[propName])) {
if(angular.isNumber(datasource[propName])) {
getter = datasource[propName];
if(Number.isInteger(getter)) {
if(angular.isNumber(getter)) {
onRenderHandlers = onRenderHandlers.filter(handler => handler.id !== propName);
onRenderHandlers.push({
id: propName,
Expand Down Expand Up @@ -502,4 +502,4 @@ angular.module('ui.scroll', [])
}

}
]);
]);

0 comments on commit 1d6eb1c

Please sign in to comment.