Permalink
Browse files

add viewport in index.html , host: 0.0.0.0

  • Loading branch information...
myliang committed Jan 29, 2019
1 parent 4b74a04 commit 1c664745ab00bc05437dfae0f4892c6e659f5fbd
Showing with 19 additions and 2 deletions.
  1. +2 −1 index.html
  2. +1 −1 src/cell.js
  3. +15 −0 src/component/table.js
  4. +1 −0 webpack.dev.js
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html style="font-size:20px">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body onload="load()">
@@ -133,7 +133,7 @@ const evalSuffixExpr = (srcStack, formulaMap, cellRender) => {
const top = stack.pop();
const bottom = stack.pop();
// Add if numeric. Concatenate otherwise.
if (!isNaN(top) && !isNaN(bottom)) {
if (!Number.isNaN(top) && !Number.isNaN(bottom)) {
stack.push(Number(top) + Number(bottom));
} else {
stack.push(bottom + top);
@@ -243,11 +243,26 @@ function renderAll(rowStart, rowLen, colStart, colLen, scrollOffset) {
renderFixedHeaders.call(this, rowStart, rowLen, colStart, colLen);
}

/*
function canvasSupportHighDPIDevices(el, ctx) {
const canvas = el;
const dpr = window.devicePixelRatio || 1;
// setTimeout(() => {
// const rect = canvas.getBoundingClientRect();
// console.log('rect:', rect.width);
// canvas.width = rect.width * dpr;
// canvas.height = rect.height * dpr;
// ctx.scale(dpr, dpr);
// }, 0);
}
*/

/** end */
class Table {
constructor(el, data) {
this.el = el;
this.context = el.getContext('2d');
// canvasSupportHighDPIDevices(el, this.context);
this.draw = new Draw(el);
this.data = data;
}
@@ -25,6 +25,7 @@ module.exports = merge(common, {
},
devtool: 'inline-source-map',
devServer: {
host: '0.0.0.0',
contentBase: './dist',
},
});

0 comments on commit 1c66474

Please sign in to comment.