@progress/kendo-angular-common
Version:
Kendo UI for Angular - Utility Package
21 lines (20 loc) • 803 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2020 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Normalizes a scroll position value in RTL mode.
*/
function rtlScrollPosition(position, element, initial) {
var result = position;
if (initial < 0) {
result = -position;
}
else if (initial > 0) {
result = element.scrollWidth - element.offsetWidth - position;
}
return result;
}
exports.rtlScrollPosition = rtlScrollPosition;