From 4f8565c5819b933076066620f53e5e743742712b Mon Sep 17 00:00:00 2001 From: Tony Germaneri Date: Wed, 30 Nov 2016 04:20:59 -0800 Subject: [PATCH] fixed errors around inherited css --- bower.json | 2 +- lib/main.js | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index 899b2987..d3b03daf 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "canvas-datagrid", "main": "lib/main.js", - "version": "0.9.0", + "version": "0.9.1", "ignore": [ "**/.*", "node_modules", diff --git a/lib/main.js b/lib/main.js index 71730c58..b71c582f 100644 --- a/lib/main.js +++ b/lib/main.js @@ -44,10 +44,11 @@ define([], function context() { ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], + ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuFontSize', '16px'], ['contextMenuFontFamily', 'sans-serif'], - ['contextMenuBackground', 'rgba(222, 227, 233, 0.90)'], + ['contextMenuBackground', 'rgba(222, 227, 233, 0.94)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuPadding', '2px'], ['contextMenuBorderRadius', '3px'], @@ -988,8 +989,8 @@ define([], function context() { cell = visibleCells.filter(function (vCell) { return vCell.columnIndex === x && vCell.rowIndex === y; })[0]; - top = container.getBoundingClientRect().top + cell.y + style.cellBorderWidth; - left = container.getBoundingClientRect().left + cell.x + style.cellBorderWidth; + top = cell.y + style.cellBorderWidth; + left = cell.x + style.cellBorderWidth; scrollEdit = { scrollTop: scrollBox.scrollTop, scrollLeft: scrollBox.scrollLeft, @@ -1328,14 +1329,16 @@ define([], function context() { } function attachCss() { var styleSheet, css = [ - '.canvas-datagrid-edit-textarea { outline: none; margin: 0; padding: 0 0 0 px;', + '.canvas-datagrid-scrollBox { overflow: auto; z-index: 1; }', + '.canvas-datagrid { box-sizing: content-box!important; padding: 0!important; background: ;}', + '.canvas-datagrid-edit-textarea { box-sizing: content-box!important; outline: none; margin: 0; padding: 0 0 0 px;', 'font-size: ; font-family: ; }', '.canvas-datagrid-context-menu-item { margin: ; border-radius: ; }', '.canvas-datagrid-context-menu-item:hover { background: ;', ' color: ; margin: ; }', '.canvas-datagrid-context-menu-label { display: ; min-width: ; }', '.canvas-datagrid-context-menu { font-family: ;', - 'font-size: ; background: ;', + 'font-size: ; background: ; color: ;', 'border: ; padding: ;', ' border-radius: ; opacity: ;}', '.canvas-datagrid-invalid-search-regExp { background: ; }' @@ -1363,10 +1366,8 @@ define([], function context() { scrollArea = document.createElement('div'); canvas = document.createElement('canvas'); ctx = canvas.getContext('2d'); - container.style.padding = '0'; - container.style.backgroundColor = style.backgroundColor; - scrollBox.style.overflow = 'auto'; - scrollBox.style.zIndex = '1'; + container.className = 'canvas-datagrid'; + scrollBox.className = 'canvas-datagrid-scrollBox'; [scrollBox, canvas, controlInput].forEach(function eachEle(el) { el.style.position = 'absolute'; });