Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ Also legacy methods that used to take tons of parameters will now take an object
```
removed `addWidget(el, x, y, width, ...)` --> use the widget options version instead `addWidget(el, {x, y, with,...})`
`float()` to get value --> `getFloat()`
'cellHeight()` to get value --> `getCellheight()`
'verticalMargin()` to get value --> `getVerticalMargin()`
```

Changes
Expand Down
15 changes: 8 additions & 7 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ gridstack.js API
- [addWidget(el, [options])](#addwidgetel-options)
- [batchUpdate()](#batchupdate)
- [compact()](#compact)
- [cellHeight()](#cellheight)
- [cellHeight(val, noUpdate)](#cellheightval-noupdate)
- [cellWidth()](#cellwidth)
- [commit()](#commit)
Expand All @@ -35,6 +34,7 @@ gridstack.js API
- [enableMove(doEnable, includeNewWidgets)](#enablemovedoenable-includenewwidgets)
- [enableResize(doEnable, includeNewWidgets)](#enableresizedoenable-includenewwidgets)
- [float(val?)](#floatval)
- [getCellHeight()](#getcellheight)
- [getCellFromPixel(position[, useOffset])](#getcellfrompixelposition-useoffset)
- [isAreaEmpty(x, y, width, height)](#isareaemptyx-y-width-height)
- [locked(el, val)](#lockedel-val)
Expand All @@ -52,7 +52,7 @@ gridstack.js API
- [setAnimation(doAnimate)](#setanimationdoanimate)
- [setStatic(staticValue)](#setstaticstaticvalue)
- [update(el, x, y, width, height)](#updateel-x-y-width-height)
- [verticalMargin()](#verticalmargin)
- [getVerticalMargin()](#getverticalmargin)
- [verticalMargin(value, noUpdate)](#verticalmarginvalue-noupdate)
- [willItFit(x, y, width, height, autoPosition)](#willitfitx-y-width-height-autoposition)
- [Utils](#utils)
Expand Down Expand Up @@ -261,10 +261,6 @@ starts batch updates. You will see no changes until `commit()` method is called.

re-layout grid items to reclaim any empty space.

### cellHeight()

Gets current cell height.

### cellHeight(val, noUpdate)

Update current cell height. This method rebuilds an internal CSS stylesheet (unless optional noUpdate=true). Note: You can expect performance issues if
Expand Down Expand Up @@ -342,6 +338,11 @@ set/get floating widgets (default: `false`)

- `val` - boolean to set true/false, else get the current value

### getCellHeight()

Gets current cell height.


### getCellFromPixel(position[, useOffset])

Get the position of the cell under a pixel on screen.
Expand Down Expand Up @@ -478,7 +479,7 @@ Parameters:

Updates widget position/size.

### verticalMargin()
### getVerticalMargin()

returns current vertical margin value.

Expand Down
25 changes: 6 additions & 19 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,20 @@

module.exports = function(config) {
config.set({
karmaTypescriptConfig: {
compilerOptions: {
module: 'commonjs',
lib: ['dom', 'es6'],
target: 'es5',
sourceMap: true,
declaration: true
}
},


// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'karma-typescript'],
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'dist/gridstack.all.js',
'spec/*-spec.js',
'src/**/*.ts'
// 'spec/e2e/*-spec.js' issues with ReferenceError: `browser` & `element` is not defined
],

Expand All @@ -40,19 +29,17 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/gridstack-dragdrop-plugin.ts': ['coverage'],
'src/gridstack.engine.ts': ['coverage'],
'src/gridstack.ts': ['coverage'],
'src/jqueryui-gridstack-dragdrop-plugin.ts': ['coverage'],
'src/utils.ts': ['coverage'],
'src/*.ts': ['karma-typescript']
'dist/gridstack-engine.js': ['coverage'],
'dist/gridstack.js': ['coverage'],
'dist/jqueryui-gridstack-dragdrop-plugin': ['coverage'],
'dist/utils.js': ['coverage']
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage', 'coveralls', 'karma-typescript'],
reporters: ['progress', 'coverage', 'coveralls'],

coverageReporter: {
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"scripts": {
"build": "yarn --no-progress && rm -rf dist/* && webpack && grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
"web": "rm -rf dist/* && webpack",
"test": "karma start karma.conf.js",
"test2": "yarn lint && karma start karma.conf.js",
"test": "yarn lint && karma start karma.conf.js",
"lint": "tsc --noEmit && eslint src/*.ts",
"reset": "rm -rf dist node_modules",
"prepublishOnly": "yarn build"
Expand Down
Loading