riku
2024-02-27 7578c3ff65329b2269f099475eb687e963efac1c
lib/tableutil.js
@@ -163,7 +163,7 @@
      });
      trC.on('click', function () {
        that.changeRowColor($(this).attr('index'));
        Table._onClick(e, i);
        Table._onClick(e, i + (that._curPage - 1) * that._perPage);
      });
      if (this._onRow != undefined) {
@@ -378,7 +378,7 @@
  },
  changeRowColor(thisIndex) {
    const index = thisIndex % this._perPage
    const index = thisIndex % this._perPage;
    if (this._lastSelectIndex != -1) {
      $(`#row-${this._lastSelectIndex}`).css('background-color', '');
    }
@@ -386,9 +386,12 @@
    const row = $(`#row-${index}`);
    row.css('background-color', 'var(--select_color)');
    var tbody = $(this._table.find('tbody')[0]);
    tbody.animate({
      scrollTop: row.outerHeight() * index - 350 + 'px',
    }, 500);
    tbody.animate(
      {
        scrollTop: row.outerHeight() * index - 350 + 'px',
      },
      500
    );
    // tbody.scrollTop(0, 100);
    // this._table.scrollTop = 100
  },