From 54187df8e0a05b66761dcac6b2b208cf9d0e1758 Mon Sep 17 00:00:00 2001 From: Tony Germaneri Date: Wed, 30 Nov 2016 03:19:40 -0800 Subject: [PATCH] fixed offset bug, added publish info --- bower.json | 22 ++++++++++++++++++++-- lib/main.js | 8 ++++---- package.json | 24 ++++++++++++++++++++---- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index a373f8a3..899b2987 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,23 @@ { - "name": "canvasGrid", + "name": "canvas-datagrid", "main": "lib/main.js", - "ignore": [] + "version": "0.9.0", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "homepage": "https://github.com/TonyGermaneri/canvas-datagrid", + "authors": [ + "Tony Germaneri " + ], + "description": "Canvas based data grid", + "keywords": [ + "Datagrid", + "grid", + "canvas" + ], + "license": "BSD" } diff --git a/lib/main.js b/lib/main.js index 494c6961..7472c673 100644 --- a/lib/main.js +++ b/lib/main.js @@ -1291,8 +1291,8 @@ define([], function context() { scrollBox.style.width = container.offsetWidth + 'px'; height = container.offsetHeight; width = container.offsetWidth; - scrollBox.style.top = container.getBoundingClientRect().top + style.headerCellHeight + (style.headerCellBorderWidth * 2) + 'px'; - scrollBox.style.left = container.getBoundingClientRect().left + 'px'; + scrollBox.style.top = style.headerCellHeight + (style.headerCellBorderWidth * 2) + 'px'; + scrollBox.style.left = '0px'; draw(); return true; } @@ -1360,13 +1360,13 @@ define([], function context() { canvas = document.createElement('canvas'); ctx = canvas.getContext('2d'); container.style.padding = '0'; - container.style.background = '#0F0'; + container.style.backgroundColor = style.backgroundColor; scrollBox.style.overflow = 'auto'; scrollBox.style.zIndex = '1'; [scrollBox, canvas, controlInput].forEach(function eachEle(el) { el.style.position = 'absolute'; }); - window.addEventListener('resize', resize); + window.addEventListener('resize', function () { requestAnimationFrame(resize); }); if (container.parentNode) { container.parentNode.addEventListener('resize', resize); } diff --git a/package.json b/package.json index 3bfc6aad..190b6737 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,24 @@ { "name": "canvas-datagrid", + "version": "0.9.0", "description": "Canvas based data grid", - "author": "tony.germaneri@gmail.com", - "version": "0.0.1", - "private": false, - "license": "BSD" + "main": "./lib/main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/TonyGermaneri/canvas-datagrid.git" + }, + "keywords": [ + "canvas", + "datagrid", + "grid" + ], + "author": "Tony Germaneri ", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/TonyGermaneri/canvas-datagrid/issues" + }, + "homepage": "https://github.com/TonyGermaneri/canvas-datagrid#readme" }