[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - loleaflet/src
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 3 11:24:03 UTC 2019
loleaflet/src/control/Ruler.js | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
New commits:
commit da9ca774e541eb56dc906c425ee57dfcd5232d63
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Dec 3 13:20:40 2019 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Dec 3 13:23:02 2019 +0200
tdf#128468: Get rid of a bunch of pointless variables
No reason to make the code even harder to understand by using
variables that don't vary but hold a constant value. Especially when
the variable names don't match their constant value.
No changes in what the code does.
Change-Id: If98ef6cdd741e76e8b4e383d005486736bf227a3
diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index 5bd4471db..4c243e2d4 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -91,16 +91,7 @@ L.Control.Ruler = L.Control.extend({
if (this._map._docLayer._annotations._items.length === 0 || !this.options.marginSet)
this.options.extraSize = 0;
- var classMajorSep = 'loleaflet-ruler-maj',
- classMargin = 'loleaflet-ruler-margin',
- classDraggable = 'loleaflet-ruler-drag',
- rightComp = 'loleaflet-ruler-right',
- leftComp = 'loleaflet-ruler-left',
- lToolTip = 'loleaflet-ruler-ltooltip',
- rToolTip = 'loleaflet-ruler-rtooltip',
- leftMarginStr = _('Left Margin'),
- rightMarginStr = _('Right Margin'),
- DraggableConvertRatio, lMargin, rMargin, wPixel, scale;
+ var DraggableConvertRatio, lMargin, rMargin, wPixel, scale;
lMargin = this.options.nullOffset;
rMargin = this.options.pageWidth - (this.options.nullOffset + this.options.margin2);
@@ -115,10 +106,10 @@ L.Control.Ruler = L.Control.extend({
var numCounter = -1 * parseInt(lMargin / 1000);
- $('.' + classMajorSep).remove();
+ $('.loleaflet-ruler-maj').remove();
for (var num = 0; num <= (this.options.pageWidth / 1000) + 1; num++) {
- var marker = L.DomUtil.create('div', classMajorSep, this._rBPContainer);
+ var marker = L.DomUtil.create('div', 'loleaflet-ruler-maj', this._rBPContainer);
marker.style.width = DraggableConvertRatio*1000 - 2 + 'px';
if (this.options.displayNumber) {
if (numCounter !== 0)
@@ -132,15 +123,15 @@ L.Control.Ruler = L.Control.extend({
this.options.marginSet = true;
- this._lMarginMarker = L.DomUtil.create('div', classMargin + ' ' + leftComp, this._rFace);
- this._rMarginMarker = L.DomUtil.create('div', classMargin + ' ' + rightComp, this._rFace);
+ this._lMarginMarker = L.DomUtil.create('div', 'loleaflet-ruler-margin loleaflet-ruler-left', this._rFace);
+ this._rMarginMarker = L.DomUtil.create('div', 'loleaflet-ruler-margin loleaflet-ruler-right', this._rFace);
- this._lMarginDrag = L.DomUtil.create('div', classDraggable + ' ' + leftComp, this._rMarginWrapper);
- this._lToolTip = L.DomUtil.create('div', lToolTip, this._lMarginDrag);
- this._rMarginDrag = L.DomUtil.create('div', classDraggable + ' ' + rightComp, this._rMarginWrapper);
- this._rToolTip = L.DomUtil.create('div', rToolTip, this._rMarginDrag);
- this._lMarginDrag.title = leftMarginStr;
- this._rMarginDrag.title = rightMarginStr;
+ this._lMarginDrag = L.DomUtil.create('div', 'loleaflet-ruler-drag loleaflet-ruler-left', this._rMarginWrapper);
+ this._lToolTip = L.DomUtil.create('div', 'loleaflet-ruler-ltooltip', this._lMarginDrag);
+ this._rMarginDrag = L.DomUtil.create('div', 'loleaflet-ruler-drag loleaflet-ruler-right', this._rMarginWrapper);
+ this._rToolTip = L.DomUtil.create('div', 'loleaflet-ruler-rtooltip', this._rMarginDrag);
+ this._lMarginDrag.title = _('Left Margin');
+ this._rMarginDrag.title = _('Right Margin');
if (window.ThisIsTheiOSApp) {
this.options.interactive = true;
More information about the Libreoffice-commits
mailing list