Jelajahi Sumber

style(handsontable): comments

qinlaiqiao 5 tahun lalu
induk
melakukan
321db1f1b2
1 mengubah file dengan 20 tambahan dan 18 penghapusan
  1. 20 18
      handsontable/src/core.js

+ 20 - 18
handsontable/src/core.js

@@ -72,7 +72,8 @@ let activeGuid = null;
 export default function Core(rootElement, userSettings, rootInstanceSymbol = false) {
   let preventScrollingToCell = false;
   let instance = this;
-  let GridSettings = function() {};
+  let GridSettings = function() {
+  };
   const eventManager = new EventManager(instance);
   let priv;
   let datamap;
@@ -538,7 +539,7 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
         }
         // should I add empty cols to meet minSpareCols?
         if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' &&
-            emptyCols < priv.settings.minSpareCols) {
+          emptyCols < priv.settings.minSpareCols) {
           for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) {
             datamap.createCol(instance.countCols(), 1, 'auto');
           }
@@ -709,8 +710,8 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
           }
           for (r = 0; r < rlen; r++) {
             if ((end && current.row > end.row && rowSelectionLength > rowInputLength) ||
-                (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) ||
-                (current.row >= priv.settings.maxRows)) {
+              (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) ||
+              (current.row >= priv.settings.maxRows)) {
               break;
             }
             const visualRow = r - skippedRow;
@@ -736,8 +737,8 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
 
             for (c = 0; c < clen; c++) {
               if ((end && current.col > end.col && colSelectionLength > colInputLength) ||
-                  (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) ||
-                  (current.col >= priv.settings.maxCols)) {
+                (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) ||
+                (current.col >= priv.settings.maxCols)) {
                 break;
               }
               cellMeta = instance.getCellMeta(current.row, current.col);
@@ -862,7 +863,8 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
         this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;
         this.checkIfQueueIsEmpty();
       },
-      onQueueEmpty() { },
+      onQueueEmpty() {
+      },
       checkIfQueueIsEmpty() {
         if (this.validatorsInQueue === 0 && resolved === false) {
           resolved = true;
@@ -1238,9 +1240,9 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
    * @function destroyEditor
    * @param {Boolean} [revertOriginal=false] If `true`, the previous value will be restored. Otherwise, the edited value will be saved.
    * @param {Boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.
-   * @param {Boolean} [prepareEditorIfNeeded=false] 解决outsideClickDeselects为False时,切换tab导致表头行号等渲染出错问题,点击表格外部,并不需要重新刷新表格
+   * @param {Boolean} [isOutClick=false] 解决outsideClickDeselects为False时,切换tab导致表头行号等渲染出错问题,点击表格外部,并不需要重新刷新表格
    */
-  this.destroyEditor = function(revertOriginal = false, prepareEditorIfNeeded = true,isOutClick = false) {
+  this.destroyEditor = function(revertOriginal = false, prepareEditorIfNeeded = true, isOutClick = false) {
     instance._refreshBorders(revertOriginal, prepareEditorIfNeeded, isOutClick);
   };
 
@@ -1357,12 +1359,12 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
   };
 
   /**
-  * Returns the last coordinates applied to the table as a CellRange object.
-  *
-  * @memberof Core#
-  * @function getSelectedRangeLast
-  * @since 0.36.0
-  * @returns {CellRange|undefined} Selected range object or undefined` if there is no selection.
+   * Returns the last coordinates applied to the table as a CellRange object.
+   *
+   * @memberof Core#
+   * @function getSelectedRangeLast
+   * @since 0.36.0
+   * @returns {CellRange|undefined} Selected range object or undefined` if there is no selection.
    */
   this.getSelectedRangeLast = function() {
     const selectedRange = this.getSelectedRange();
@@ -2200,7 +2202,7 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
   this.getDataType = function(rowFrom, columnFrom, rowTo, columnTo) {
     const coords = rowFrom === void 0 ? [0, 0, this.countRows(), this.countCols()] : [rowFrom, columnFrom, rowTo, columnTo];
     const [rowStart, columnStart] = coords;
-    let [,, rowEnd, columnEnd] = coords;
+    let [, , rowEnd, columnEnd] = coords;
     let previousType = null;
     let currentType = null;
 
@@ -3583,9 +3585,9 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
    * @param {Boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.
    * @param {Boolean} [isOutClick=false] If `false` 重新刷新表格. If ture 说明是点击表格外不需要重新刷新
    */
-  this._refreshBorders = function(revertOriginal = false, prepareEditorIfNeeded = true,isOutClick = false) {
+  this._refreshBorders = function(revertOriginal = false, prepareEditorIfNeeded = true, isOutClick = false) {
     editorManager.destroyEditor(revertOriginal);
-    if( isOutClick===false ) instance.view.render();
+    if (isOutClick === false) instance.view.render();
 
     if (prepareEditorIfNeeded && selection.isSelected()) {
       editorManager.prepareEditor();