From 2871e1d3b7c514bc47ba31ae66e63ac90700491d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kay=20=C5=9Eat=C4=B1r?= Date: Wed, 30 Dec 2020 11:23:09 +0300 Subject: [PATCH] Control.Header: Bring non-shared functions from rows and columns into header class. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebased with master. gitignore file is updated. Signed-off-by: Gökay Şatır Change-Id: I07c9f8e38db0dce7b50238e2c013d3521091ab25 --- loleaflet/Makefile.am | 4 +- loleaflet/src/control/Control.ColumnHeader.js | 201 --------- loleaflet/src/control/Control.Header.js | 381 +++++++++++++++++- loleaflet/src/control/Control.RowHeader.js | 177 -------- 4 files changed, 382 insertions(+), 381 deletions(-) diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am index 3db506f3c..b92c32c2a 100644 --- a/loleaflet/Makefile.am +++ b/loleaflet/Makefile.am @@ -28,9 +28,9 @@ $(L10N_IOS_ALL_JS) : $(wildcard $(srcdir)/po/ui-*.po) $(shell find $(srcdir)/l10 endif SRC_TS = $(wildcard src/layer/tile/*.ts) -SRC_TS_JS = $(patsubst src/layer/tile/%.ts,$(DIST_FOLDER)/src/layer/tile/%.js,$(SRC_TS)) +SRC_TS_JS = $(patsubst src/layer/tile/%.ts,src/layer/tile/%.js,$(SRC_TS)) -dist/src/layer/tile/%.js: src/layer/tile/%.ts +src/layer/tile/%.js: src/layer/tile/%.ts $(srcdir)/node_modules/typescript/bin/tsc $< --outfile $@ --module none --lib dom,es2016 --target ES5 JQUERY_LIGHTNESS_IMAGE_PATH = $(srcdir)/images/jquery-ui-lightness diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 59c5ab9f0..cf6f1df01 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -102,56 +102,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({ } }, - optimalWidth: function(index) { - if (!this.isHighlighted(index)) { - this._selectColumn(index, 0); - } - this._map.sendUnoCommand('.uno:SetOptimalColumnWidth'); - }, - - insertColumnBefore: function(index) { - // First select the corresponding column because - // .uno:InsertColumn doesn't accept any column number - // as argument and just inserts before the selected column - if (!this.isHighlighted(index)) { - this._selectColumn(index, 0); - } - this._map.sendUnoCommand('.uno:InsertColumns'); - this._updateColumnHeader(); - }, - - insertColumnAfter: function(index) { - if (!this.isHighlighted(index)) { - this._selectColumn(index, 0); - } - this._map.sendUnoCommand('.uno:InsertColumnsAfter'); - this._updateColumnHeader(); - }, - - deleteColumn: function(index) { - if (!this.isHighlighted(index)) { - this._selectColumn(index, 0); - } - this._map.sendUnoCommand('.uno:DeleteColumns'); - this._updateColumnHeader(); - }, - - hideColumn: function(index) { - if (!this.isHighlighted(index)) { - this._selectColumn(index, 0); - } - this._map.sendUnoCommand('.uno:HideColumn'); - this._updateColumnHeader(); - }, - - showColumn: function(index) { - if (!this.isHighlighted(index)) { - this._selectColumn(index, 0); - } - this._map.sendUnoCommand('.uno:ShowColumn'); - this._updateColumnHeader(); - }, - _updateCanvas: function () { if (this._headerInfo) { this._headerInfo.update(); @@ -175,17 +125,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this.updateSelection(start, end); }, - _onUpdateCurrentColumn: function (e) { - var x = e.curX - 1; // 1-based to 0-based. - var w = this._twipsToPixels(e.width); - var slim = w <= 1; - this.updateCurrent(x, slim); - }, - - _updateColumnHeader: function () { - this._map._docLayer.refreshViewData({x: this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}}); - }, - drawHeaderEntry: function (entry, isOver, isHighlighted, isCurrent) { if (!entry) return; @@ -374,63 +313,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({ } }, - fillColumns: function (columns, colGroups, converter, context) { - if (columns && columns.length < 2) - return; - - var canvas = this._canvas; - this._setCanvasWidth(); - this._setCanvasHeight(); - this._canvasContext.clearRect(0, 0, canvas.width, canvas.height); - - // Reset state - this._current = -1; - this._selection.start = this._selection.end = -1; - this._mouseOverEntry = null; - if (!window.contextMenuWizard) { - this._lastMouseOverIndex = undefined; - } - - var sheetGeometry = this._map._docLayer.sheetGeometry; - - if (!this._headerInfo) { - // create data structure for column widths - this._headerInfo = new L.Control.Header.HeaderInfo(this._map, true /* isCol */); - this._map._colHdr = this._headerInfo; - } - - // setup conversion routine - this.converter = L.Util.bind(converter, context); - - // create group array - this._groupLevels = columns ? parseInt(columns[0].groupLevels): - sheetGeometry.getColumnGroupLevels(); - this._groups = this._groupLevels ? new Array(this._groupLevels) : null; - - // collect group controls data - if (colGroups !== undefined && this._groups) { - this._collectGroupsData(colGroups); - } - else if (sheetGeometry) { - this._collectGroupsData(sheetGeometry.getColumnGroupsDataInView()); - } - - if (this._groups) { - this.resize(this._computeOutlineWidth() + this._borderWidth + this._headerHeight); - } - else if (this._canvasHeight !== this._headerHeight) { - this.resize(this._headerHeight); - } - - this._redrawHeaders(); - - this.mouseInit(canvas); - - if ($('.spreadsheet-header-columns').length > 0) { - $('.spreadsheet-header-columns').contextMenu(this._map.isPermissionEdit()); - } - }, - _redrawHeaders: function () { this._canvasContext.clearRect(0, 0, this._canvas.width, this._canvas.height); this._headerInfo.forEachElement(function(elemData) { @@ -441,36 +323,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this.drawOutline(); }, - _colIndexToAlpha: function(columnNumber) { - var offset = 'A'.charCodeAt(); - var dividend = columnNumber; - var columnName = ''; - var modulo; - - while (dividend > 0) { - modulo = (dividend - 1) % 26; - columnName = String.fromCharCode(offset + modulo) + columnName; - dividend = Math.floor((dividend - modulo) / 26); - } - - return columnName; - }, - - _selectColumn: function(colNumber, modifier) { - var command = { - Col: { - type: 'unsigned short', - value: colNumber - }, - Modifier: { - type: 'unsigned short', - value: modifier - } - }; - - this._map.sendUnoCommand('.uno:SelectColumn ', command); - }, - _onClick: function (e) { if (this._onOutlineMouseEvent(e, this._onGroupControlClick)) return; @@ -525,17 +377,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this._map.enable(true); }, - _getVertLatLng: function (start, offset, e) { - var size = this._map.getSize(); - var drag = this._map.mouseEventToContainerPoint(e); - var entryStart = (this._dragEntry.pos - this._dragEntry.size) / this._dpiScale; - var xpos = Math.max(drag.x, entryStart); - return [ - this._map.unproject(new L.Point(xpos, 0)), - this._map.unproject(new L.Point(xpos, size.y)), - ]; - }, - onDragStart: function (item, start, offset, e) { if (!this._vertLine) { this._vertLine = L.polyline(this._getVertLatLng(start, offset, e), {color: 'darkblue', weight: 1, fixed: true}); @@ -657,48 +498,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this._map.fire('updatecornerheader'); }, - - _insertColBefore: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.insertColumnBefore.call(this, index); - } - }, - - _insertColAfter: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.insertColumnAfter.call(this, index); - } - }, - - _deleteSelectedCol: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.deleteColumn.call(this, index); - } - }, - - _optimalWidth: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.optimalWidth.call(this, index); - } - }, - - _hideColumn: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.hideColumn.call(this, index); - } - }, - - _showColumn: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.showColumn.call(this, index); - } - } }); L.control.columnHeader = function (options) { diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 960a15ad0..990211d0e 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -5,7 +5,7 @@ * Abstract class, basis for ColumnHeader and RowHeader controls. * Used only in spreadsheets, implements the row/column headers. */ -/* global L Hammer */ +/* global $ L Hammer */ L.Control.Header = L.Control.extend({ options: { @@ -269,6 +269,385 @@ L.Control.Header = L.Control.extend({ this._current = entry && !zeroSizeEntry ? entry.index : -1; }, + optimalHeight: function(index) { + if (!this.isHighlighted(index)) { + this._selectRow(index, 0); + } + this._map.sendUnoCommand('.uno:SetOptimalRowHeight'); + }, + + insertRowAbove: function(index) { + // First select the corresponding row because + // .uno:InsertRows doesn't accept any row number + // as argument and just inserts before the selected row + if (!this.isHighlighted(index)) { + this._selectRow(index, 0); + } + this._map.sendUnoCommand('.uno:InsertRows'); + }, + + insertRowBelow: function(index) { + if (!this.isHighlighted(index)) { + this._selectRow(index, 0); + } + this._map.sendUnoCommand('.uno:InsertRowsAfter'); + }, + + deleteRow: function(index) { + if (!this.isHighlighted(index)) { + this._selectRow(index, 0); + } + this._map.sendUnoCommand('.uno:DeleteRows'); + }, + + hideRow: function(index) { + if (!this.isHighlighted(index)) { + this._selectRow(index, 0); + } + this._map.sendUnoCommand('.uno:HideRow'); + }, + + showRow: function(index) { + if (!this.isHighlighted(index)) { + this._selectRow(index, 0); + } + this._map.sendUnoCommand('.uno:ShowRow'); + }, + + _onUpdateCurrentRow: function (e) { + var y = e.curY - 1; // 1-based to 0-based. + var h = this._twipsToPixels(e.height); + var slim = h <= 1; + this.updateCurrent(y, slim); + }, + + + fillRows: function (rows, rowGroups, converter, context) { + if (rows && rows.length < 2) + return; + + var canvas = this._canvas; + this._setCanvasWidth(); + this._setCanvasHeight(); + this._canvasContext.clearRect(0, 0, canvas.width, canvas.height); + + // Reset state + this._current = -1; + this._selection.start = this._selection.end = -1; + this._mouseOverEntry = null; + if (!window.contextMenuWizard) { + this._lastMouseOverIndex = undefined; + } + + var sheetGeometry = this._map._docLayer.sheetGeometry; + + if (!this._headerInfo) { + // create data structure for row heights + this._headerInfo = new L.Control.Header.HeaderInfo(this._map, false /* isCol */); + this._map._rowHdr = this._headerInfo; + } + + // setup conversion routine + this.converter = L.Util.bind(converter, context); + + // create group array + this._groupLevels = rows ? parseInt(rows[0].groupLevels) : + sheetGeometry.getRowGroupLevels(); + this._groups = this._groupLevels ? new Array(this._groupLevels) : null; + + // collect group controls data + if (rowGroups !== undefined && this._groups) { + this._collectGroupsData(rowGroups); + } + else if (sheetGeometry) { + this._collectGroupsData(sheetGeometry.getRowGroupsDataInView()); + } + + if (this._groups) { + this.resize(this._computeOutlineWidth() + this._borderWidth + this._headerWidth); + } + else if (this._canvasWidth !== this._headerWidth) { + this.resize(this._headerWidth); + } + + this._redrawHeaders(); + + this.mouseInit(canvas); + + if ($('.spreadsheet-header-rows').length > 0) { + $('.spreadsheet-header-rows').contextMenu(this._map.isPermissionEdit()); + } + }, + + _selectRow: function(row, modifier) { + var command = { + Row: { + type: 'long', + value: row + }, + Modifier: { + type: 'unsigned short', + value: modifier + } + }; + + this._map.sendUnoCommand('.uno:SelectRow ', command); + }, + + _insertRowAbove: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.insertRowAbove.call(this, index); + } + }, + + _insertRowBelow: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.insertRowBelow.call(this, index); + } + }, + + _deleteSelectedRow: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.deleteRow.call(this, index); + } + }, + + _optimalHeight: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.optimalHeight.call(this, index); + } + }, + + _hideRow: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.hideRow.call(this, index); + } + }, + + _showRow: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.showRow.call(this, index); + } + }, + + _getHorzLatLng: function (start, offset, e) { + var size = this._map.getSize(); + var drag = this._map.mouseEventToContainerPoint(e); + var entryStart = (this._dragEntry.pos - this._dragEntry.size) / this._dpiScale; + var ypos = Math.max(drag.y, entryStart); + return [ + this._map.unproject(new L.Point(0, ypos)), + this._map.unproject(new L.Point(size.x, ypos)), + ]; + }, + + optimalWidth: function(index) { + if (!this.isHighlighted(index)) { + this._selectColumn(index, 0); + } + this._map.sendUnoCommand('.uno:SetOptimalColumnWidth'); + }, + + insertColumnBefore: function(index) { + // First select the corresponding column because + // .uno:InsertColumn doesn't accept any column number + // as argument and just inserts before the selected column + if (!this.isHighlighted(index)) { + this._selectColumn(index, 0); + } + this._map.sendUnoCommand('.uno:InsertColumns'); + this._updateColumnHeader(); + }, + + insertColumnAfter: function(index) { + if (!this.isHighlighted(index)) { + this._selectColumn(index, 0); + } + this._map.sendUnoCommand('.uno:InsertColumnsAfter'); + this._updateColumnHeader(); + }, + + deleteColumn: function(index) { + if (!this.isHighlighted(index)) { + this._selectColumn(index, 0); + } + this._map.sendUnoCommand('.uno:DeleteColumns'); + this._updateColumnHeader(); + }, + + hideColumn: function(index) { + if (!this.isHighlighted(index)) { + this._selectColumn(index, 0); + } + this._map.sendUnoCommand('.uno:HideColumn'); + this._updateColumnHeader(); + }, + + showColumn: function(index) { + if (!this.isHighlighted(index)) { + this._selectColumn(index, 0); + } + this._map.sendUnoCommand('.uno:ShowColumn'); + this._updateColumnHeader(); + }, + + _onUpdateCurrentColumn: function (e) { + var x = e.curX - 1; // 1-based to 0-based. + var w = this._twipsToPixels(e.width); + var slim = w <= 1; + this.updateCurrent(x, slim); + }, + + _updateColumnHeader: function () { + this._map._docLayer.refreshViewData({x: this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}}); + }, + + fillColumns: function (columns, colGroups, converter, context) { + if (columns && columns.length < 2) + return; + + var canvas = this._canvas; + this._setCanvasWidth(); + this._setCanvasHeight(); + this._canvasContext.clearRect(0, 0, canvas.width, canvas.height); + + // Reset state + this._current = -1; + this._selection.start = this._selection.end = -1; + this._mouseOverEntry = null; + if (!window.contextMenuWizard) { + this._lastMouseOverIndex = undefined; + } + + var sheetGeometry = this._map._docLayer.sheetGeometry; + + if (!this._headerInfo) { + // create data structure for column widths + this._headerInfo = new L.Control.Header.HeaderInfo(this._map, true /* isCol */); + this._map._colHdr = this._headerInfo; + } + + // setup conversion routine + this.converter = L.Util.bind(converter, context); + + // create group array + this._groupLevels = columns ? parseInt(columns[0].groupLevels): + sheetGeometry.getColumnGroupLevels(); + this._groups = this._groupLevels ? new Array(this._groupLevels) : null; + + // collect group controls data + if (colGroups !== undefined && this._groups) { + this._collectGroupsData(colGroups); + } + else if (sheetGeometry) { + this._collectGroupsData(sheetGeometry.getColumnGroupsDataInView()); + } + + if (this._groups) { + this.resize(this._computeOutlineWidth() + this._borderWidth + this._headerHeight); + } + else if (this._canvasHeight !== this._headerHeight) { + this.resize(this._headerHeight); + } + + this._redrawHeaders(); + + this.mouseInit(canvas); + + if ($('.spreadsheet-header-columns').length > 0) { + $('.spreadsheet-header-columns').contextMenu(this._map.isPermissionEdit()); + } + }, + + _colIndexToAlpha: function(columnNumber) { + var offset = 'A'.charCodeAt(); + var dividend = columnNumber; + var columnName = ''; + var modulo; + + while (dividend > 0) { + modulo = (dividend - 1) % 26; + columnName = String.fromCharCode(offset + modulo) + columnName; + dividend = Math.floor((dividend - modulo) / 26); + } + + return columnName; + }, + + _selectColumn: function(colNumber, modifier) { + var command = { + Col: { + type: 'unsigned short', + value: colNumber + }, + Modifier: { + type: 'unsigned short', + value: modifier + } + }; + + this._map.sendUnoCommand('.uno:SelectColumn ', command); + }, + + _getVertLatLng: function (start, offset, e) { + var size = this._map.getSize(); + var drag = this._map.mouseEventToContainerPoint(e); + var entryStart = (this._dragEntry.pos - this._dragEntry.size) / this._dpiScale; + var xpos = Math.max(drag.x, entryStart); + return [ + this._map.unproject(new L.Point(xpos, 0)), + this._map.unproject(new L.Point(xpos, size.y)), + ]; + }, + + _insertColBefore: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.insertColumnBefore.call(this, index); + } + }, + + _insertColAfter: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.insertColumnAfter.call(this, index); + } + }, + + _deleteSelectedCol: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.deleteColumn.call(this, index); + } + }, + + _optimalWidth: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.optimalWidth.call(this, index); + } + }, + + _hideColumn: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.hideColumn.call(this, index); + } + }, + + _showColumn: function() { + var index = this._lastMouseOverIndex; + if (index) { + this.showColumn.call(this, index); + } + }, + _onPan: function (event) { if (event.pointerType !== 'touch' || !this._map.isPermissionEdit()) return; diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index de03b9056..f0a25b5a9 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -101,51 +101,6 @@ L.Control.RowHeader = L.Control.Header.extend({ }, - optimalHeight: function(index) { - if (!this.isHighlighted(index)) { - this._selectRow(index, 0); - } - this._map.sendUnoCommand('.uno:SetOptimalRowHeight'); - }, - - insertRowAbove: function(index) { - // First select the corresponding row because - // .uno:InsertRows doesn't accept any row number - // as argument and just inserts before the selected row - if (!this.isHighlighted(index)) { - this._selectRow(index, 0); - } - this._map.sendUnoCommand('.uno:InsertRows'); - }, - - insertRowBelow: function(index) { - if (!this.isHighlighted(index)) { - this._selectRow(index, 0); - } - this._map.sendUnoCommand('.uno:InsertRowsAfter'); - }, - - deleteRow: function(index) { - if (!this.isHighlighted(index)) { - this._selectRow(index, 0); - } - this._map.sendUnoCommand('.uno:DeleteRows'); - }, - - hideRow: function(index) { - if (!this.isHighlighted(index)) { - this._selectRow(index, 0); - } - this._map.sendUnoCommand('.uno:HideRow'); - }, - - showRow: function(index) { - if (!this.isHighlighted(index)) { - this._selectRow(index, 0); - } - this._map.sendUnoCommand('.uno:ShowRow'); - }, - _updateCanvas: function () { if (this._headerInfo) { this._headerInfo.update(); @@ -169,13 +124,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this.updateSelection(start, end); }, - _onUpdateCurrentRow: function (e) { - var y = e.curY - 1; // 1-based to 0-based. - var h = this._twipsToPixels(e.height); - var slim = h <= 1; - this.updateCurrent(y, slim); - }, - drawHeaderEntry: function (entry, isOver, isHighlighted, isCurrent) { if (!entry) return; @@ -363,63 +311,6 @@ L.Control.RowHeader = L.Control.Header.extend({ } }, - fillRows: function (rows, rowGroups, converter, context) { - if (rows && rows.length < 2) - return; - - var canvas = this._canvas; - this._setCanvasWidth(); - this._setCanvasHeight(); - this._canvasContext.clearRect(0, 0, canvas.width, canvas.height); - - // Reset state - this._current = -1; - this._selection.start = this._selection.end = -1; - this._mouseOverEntry = null; - if (!window.contextMenuWizard) { - this._lastMouseOverIndex = undefined; - } - - var sheetGeometry = this._map._docLayer.sheetGeometry; - - if (!this._headerInfo) { - // create data structure for row heights - this._headerInfo = new L.Control.Header.HeaderInfo(this._map, false /* isCol */); - this._map._rowHdr = this._headerInfo; - } - - // setup conversion routine - this.converter = L.Util.bind(converter, context); - - // create group array - this._groupLevels = rows ? parseInt(rows[0].groupLevels) : - sheetGeometry.getRowGroupLevels(); - this._groups = this._groupLevels ? new Array(this._groupLevels) : null; - - // collect group controls data - if (rowGroups !== undefined && this._groups) { - this._collectGroupsData(rowGroups); - } - else if (sheetGeometry) { - this._collectGroupsData(sheetGeometry.getRowGroupsDataInView()); - } - - if (this._groups) { - this.resize(this._computeOutlineWidth() + this._borderWidth + this._headerWidth); - } - else if (this._canvasWidth !== this._headerWidth) { - this.resize(this._headerWidth); - } - - this._redrawHeaders(); - - this.mouseInit(canvas); - - if ($('.spreadsheet-header-rows').length > 0) { - $('.spreadsheet-header-rows').contextMenu(this._map.isPermissionEdit()); - } - }, - _redrawHeaders: function () { this._canvasContext.clearRect(0, 0, this._canvas.width, this._canvas.height); this._headerInfo.forEachElement(function(elemData) { @@ -430,21 +321,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this.drawOutline(); }, - _selectRow: function(row, modifier) { - var command = { - Row: { - type: 'long', - value: row - }, - Modifier: { - type: 'unsigned short', - value: modifier - } - }; - - this._map.sendUnoCommand('.uno:SelectRow ', command); - }, - _onClick: function (e) { if (this._onOutlineMouseEvent(e, this._onGroupControlClick)) return; @@ -493,17 +369,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this._map.enable(true); }, - _getHorzLatLng: function (start, offset, e) { - var size = this._map.getSize(); - var drag = this._map.mouseEventToContainerPoint(e); - var entryStart = (this._dragEntry.pos - this._dragEntry.size) / this._dpiScale; - var ypos = Math.max(drag.y, entryStart); - return [ - this._map.unproject(new L.Point(0, ypos)), - this._map.unproject(new L.Point(size.x, ypos)), - ]; - }, - onDragStart: function (item, start, offset, e) { if (!this._horzLine) { this._horzLine = L.polyline(this._getHorzLatLng(start, offset, e), {color: 'darkblue', weight: 1, fixed: true}); @@ -629,48 +494,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this._map.fire('updatecornerheader'); }, - - _insertRowAbove: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.insertRowAbove.call(this, index); - } - }, - - _insertRowBelow: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.insertRowBelow.call(this, index); - } - }, - - _deleteSelectedRow: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.deleteRow.call(this, index); - } - }, - - _optimalHeight: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.optimalHeight.call(this, index); - } - }, - - _hideRow: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.hideRow.call(this, index); - } - }, - - _showRow: function() { - var index = this._lastMouseOverIndex; - if (index) { - this.showRow.call(this, index); - } - } }); L.control.rowHeader = function (options) {