зеркало из https://github.com/mozilla/pjs.git
Bug 297780 - undetermined progress meter goes left to right in RTL interface
p=Ryan Jones <sciguyryan@gmail.com> r=mano
This commit is contained in:
Родитель
867b01dd28
Коммит
73f9f8ce7a
|
@ -66,16 +66,27 @@
|
|||
<body><![CDATA[
|
||||
var stack = document.getAnonymousElementByAttribute(this, "anonid", "stack");
|
||||
var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
|
||||
var position = -1;
|
||||
|
||||
var isLTR =
|
||||
document.defaultView.getComputedStyle(this, null).direction == "ltr";
|
||||
|
||||
var position = isLTR ? 4 : -1;
|
||||
var interval = setInterval(function nextStep() {
|
||||
try {
|
||||
var width = stack.boxObject.width >> 2;
|
||||
spacer.height = stack.boxObject.height;
|
||||
spacer.width = width;
|
||||
spacer.left = width * position;
|
||||
position += 15 / (width + 150);
|
||||
if (position >= 4)
|
||||
position = -1;
|
||||
if (isLTR) {
|
||||
position += 15 / (width + 150);
|
||||
if (position >= 4)
|
||||
position = -1;
|
||||
}
|
||||
else {
|
||||
position -= 15 / (width + 150);
|
||||
if (position < 0)
|
||||
position = 4;
|
||||
}
|
||||
} catch (e) {
|
||||
clearInterval(interval);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче