Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
modularizer committed Mar 4, 2024
1 parent 07697dc commit 27fc2ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 6 additions & 2 deletions css/teebydeeby.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ teeby-deeby {
opacity: 0.8;
}

th.up:hover::before {
th.none:hover::before,
th.none:hover::after {
opacity: 0.3;
}
th.up:hover::before {
opacity: 0.5;
}
th.down:hover::after {
opacity: 0.3;
opacity: 0.5;
}

tbody:hover {
Expand Down
12 changes: 8 additions & 4 deletions js/teebydeeby.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class TeebyDeeby extends HTMLElement {
constructor() {
super();

this._pageSize = 50;
this._pageSize = 25;
this._page = 0;


Expand Down Expand Up @@ -145,15 +145,18 @@ class TeebyDeeby extends HTMLElement {
this._headersEditable = this.getAttribute('headerseditable') || url.searchParams.get('headerseditable') || false;


this._pageSize = parseInt(this.getAttribute('pagesize') || url.searchParams.get('pagesize') || 50);
let _pageSize = this.getAttribute('pagesize') || url.searchParams.get('pagesize');
this._pageSize = parseInt(this.getAttribute('pagesize') || url.searchParams.get('pagesize') || this._pageSize);
if (this._pageSize instanceof String || typeof this._pageSize === 'string'){
this._pageSize = parseInt(this._pageSize);
}
this._page = parseInt(this.getAttribute('page') || url.searchParams.get('page') || 0);
let _page = this.getAttribute('page') || url.searchParams.get('page');
this._page = parseInt(_page || this._page);
if (this._page instanceof String || typeof this._page === 'string'){
this._page = parseInt(this._page);
}
if (((this.getAttribute('page') || url.searchParams.get('page')) === null) && (this._pageSize > 0)){
console.warn("page", _page, this.getAttribute('page'), url.searchParams.get('page'), (this.getAttribute('page') || url.searchParams.get('page')));
if ((_page === null) && (parseInt(_pageSize) > 0)){
this._page = 1;
}
if ((this._page > 0) && (this._pageSize > 0)){
Expand Down Expand Up @@ -428,6 +431,7 @@ class TeebyDeeby extends HTMLElement {
// add th tag cell to headers row
let th = document.createElement('th');
th.innerHTML = headerKey;
th.classList.add('none');
if (this._headersEditable){
th.setAttribute('contenteditable', true);
th.addEventListener('input', (e) => {
Expand Down
Loading

0 comments on commit 27fc2ee

Please sign in to comment.