[Libreoffice-commits] online.git: loleaflet/src
Ozcan Esen
ozcan.esen at collabora.com
Mon Dec 28 15:40:46 PST 2015
loleaflet/src/control/Control.PartsPreview.js | 10 +++++-----
loleaflet/src/control/Control.Presentation.js | 17 ++++++++---------
2 files changed, 13 insertions(+), 14 deletions(-)
New commits:
commit 7089ec49a2b60ca83354dd61e304163f75f107d0
Author: Ozcan Esen <ozcan.esen at collabora.com>
Date: Mon Dec 28 23:43:21 2015 +0200
loleaflet: clean up linter warnings
Change-Id: Ic17c4eb813d408e4f9648d40e1e944c23c9cb129
Reviewed-on: https://gerrit.libreoffice.org/20995
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index df9a36f..93a2cfa 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -48,8 +48,8 @@ L.Control.PartsPreview = L.Control.extend({
else
{
// change the border style of the selected preview.
- for (var i = 0; i < parts; i++) {
- L.DomUtil.removeClass(this._previewTiles[i], 'preview-img-selected');
+ for (var j = 0; j < parts; j++) {
+ L.DomUtil.removeClass(this._previewTiles[j], 'preview-img-selected');
}
L.DomUtil.addClass(this._previewTiles[selectedPart], 'preview-img-selected');
}
@@ -103,7 +103,7 @@ L.Control.PartsPreview = L.Control.extend({
_updatePreviewIds: function () {
// TO DO: preview-tileX prefix is unneccessary, can be removed completely
// since we have them in this._previewTiles[]
- for (var i=0; i < this._previewTiles.length; i++) {
+ for (var i = 0; i < this._previewTiles.length; i++) {
this._previewTiles[i].id = 'preview-tile' + i;
}
$('.parts-preview').mCustomScrollbar('update');
@@ -116,7 +116,7 @@ L.Control.PartsPreview = L.Control.extend({
// insert newPreview to newIndex position
this._previewTiles.splice(newIndex, 0, newPreview);
- var selectedFrame = this._previewTiles[e.selectedPart].parentNode;
+ var selectedFrame = this._previewTiles[e.selectedPart].parentNode;
var newFrame = newPreview.parentNode;
// insert after selectedFrame
@@ -127,7 +127,7 @@ L.Control.PartsPreview = L.Control.extend({
_deletePreview: function (e) {
var selectedFrame = this._previewTiles[e.selectedPart].parentNode;
L.DomUtil.remove(selectedFrame);
-
+
this._previewTiles.splice(e.selectedPart, 1);
this._updatePreviewIds();
}
diff --git a/loleaflet/src/control/Control.Presentation.js b/loleaflet/src/control/Control.Presentation.js
index 944d51c..469dd3a 100644
--- a/loleaflet/src/control/Control.Presentation.js
+++ b/loleaflet/src/control/Control.Presentation.js
@@ -4,7 +4,7 @@
L.Control.Presentation = L.Control.extend({
options: {
- position: 'topleft',
+ position: 'topleft'
},
onAdd: function (map) {
@@ -14,8 +14,8 @@ L.Control.Presentation = L.Control.extend({
this._buttons = {
'insertpage': {title: 'Insert Page', uno: 'InsertPage', iconName: 'insertpage.png'},
'duplicatepage': {title: 'Duplicate Page', uno: 'DuplicatePage', iconName: 'duplicatepage.png'},
- 'deletepage': {title: 'Delete Page', uno: 'DeletePage', iconName: 'deletepage.png'},
- }
+ 'deletepage': {title: 'Delete Page', uno: 'DeletePage', iconName: 'deletepage.png'}
+ };
for (var key in this._buttons) {
var button = this._buttons[key];
@@ -23,7 +23,7 @@ L.Control.Presentation = L.Control.extend({
buttonsName, container, this._onButtonClick);
}
- map.on('updateparts', this._updateDisabled, this)
+ map.on('updateparts', this._updateDisabled, this);
return container;
},
@@ -36,7 +36,7 @@ L.Control.Presentation = L.Control.extend({
for (var key in this._buttons) {
var button = this._buttons[key];
L.DomUtil.addClass(button.el, 'leaflet-disabled');
- L.DomUtil.addClass(button.el, 'leaflet-control-buttons-disabled');
+ L.DomUtil.addClass(button.el, 'leaflet-control-buttons-disabled');
}
},
@@ -79,7 +79,7 @@ L.Control.Presentation = L.Control.extend({
if (id === 'insertpage' || id === 'duplicatepage') {
this._map.fire('insertpage', {
selectedPart: docLayer._selectedPart,
- parts: docLayer._parts,
+ parts: docLayer._parts
});
docLayer._parts++;
@@ -88,18 +88,17 @@ L.Control.Presentation = L.Control.extend({
else if (id === 'deletepage') {
this._map.fire('deletepage', {
selectedPart: docLayer._selectedPart,
- parts: docLayer._parts,
+ parts: docLayer._parts
});
docLayer._parts--;
-
if (docLayer._selectedPart >= docLayer._parts) {
docLayer._selectedPart--;
}
this._map.setPart(docLayer._selectedPart);
}
- },
+ }
});
L.control.presentation = function (options) {
More information about the Libreoffice-commits
mailing list