Skip to content

Commit 7a56e8f

Browse files
authored
Merge pull request #2312 from adumesny/master
doc update
2 parents 93bf30c + 1848db6 commit 7a56e8f

File tree

2 files changed

+16
-29
lines changed

2 files changed

+16
-29
lines changed

README.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ GridStack no longer requires external dependencies as of v1.0.0 (lodash was remo
148148
search for ['gridstack' under NPM](https://www.npmjs.com/search?q=gridstack&ranking=popularity) for latest, more to come...
149149

150150
- **Angular**: we now ship out of the box with Angular wrapper components - see <a href="https://github.com/gridstack/gridstack.js/tree/master/demo/angular/src/app" target="_blank">Angular Demo</a>.
151-
- **Angular9**: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance so recommend for **concept ONLY if you wish to use directive instead**.
151+
- **Angular9**: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance so recommend for **concept ONLY if you wish to use directive instead**. teh code has been vented as I use components.
152152
- **AngularJS**: [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
153153
- **Ember**: [ember-gridstack](https://github.com/yahoo/ember-gridstack)
154154
- **knockout**: see [demo](https://gridstackjs.com/demo/knockout.html) using component, but check [custom bindings ticket](https://github.com/gridstack/gridstack.js/issues/465) which is likely better approach.
@@ -219,36 +219,23 @@ See example: [2 grids demo](http://gridstack.github.io/gridstack.js/demo/two.htm
219219

220220
If you need > 12 columns or want to generate the CSS manually you will need to generate CSS rules for `.grid-stack-item[gs-w="X"]` and `.grid-stack-item[gs-x="X"]`.
221221

222-
For instance for 3-column grid you need to rewrite CSS to be:
222+
For instance for 4-column grid you need to write CSS to be:
223223

224224
```css
225-
.grid-stack-item[gs-w="3"] { width: 100% }
226-
.grid-stack-item[gs-w="2"] { width: 66.67% }
227-
.grid-stack-item[gs-w="1"] { width: 33.33% }
228-
229-
.grid-stack-item[gs-x="2"] { left: 66.67% }
230-
.grid-stack-item[gs-x="1"] { left: 33.33% }
231-
```
232-
233-
For 4-column grid it should be:
234-
235-
```css
236-
.grid-stack-item[gs-w="4"] { width: 100% }
237-
.grid-stack-item[gs-w="3"] { width: 75% }
238-
.grid-stack-item[gs-w="2"] { width: 50% }
239-
.grid-stack-item[gs-w="1"] { width: 25% }
240-
241-
.grid-stack-item[gs-x="3"] { left: 75% }
242-
.grid-stack-item[gs-x="2"] { left: 50% }
243-
.grid-stack-item[gs-x="1"] { left: 25% }
225+
.grid-stack-4 > .grid-stack-item { min-width: 25% }
226+
.grid-stack-4 > .grid-stack-item[gs-w="4"] { width: 100% }
227+
.grid-stack-4 > .grid-stack-item[gs-w="3"] { width: 75% }
228+
.grid-stack-4 > .grid-stack-item[gs-w="2"] { width: 50% }
229+
230+
.grid-stack-4 > .grid-stack-item[gs-x="3"] { left: 75% }
231+
.grid-stack-4 > .grid-stack-item[gs-x="2"] { left: 50% }
232+
.grid-stack-4 > .grid-stack-item[gs-x="1"] { left: 25% }
244233
```
245234

246-
and so on.
247-
248235
Better yet, here is a SASS code snippet, you can use sites like [sassmeister.com](https://www.sassmeister.com/) to generate the CSS for you instead:
249236

250237
```sass
251-
$columns: 12;
238+
$columns: 20;
252239
@function fixed($float) {
253240
@return calc(round($float * 100) / 100); // total 4 digits being %
254241
}
@@ -449,11 +436,11 @@ New addition, no API breakage per say. See release notes about creating sub-grid
449436
## Migrating to v8
450437
451438
Possible breaking change if you use nested grid JSON format, or original Angular wrapper, or relied on specific CSS paths. Also target is now ES2020 (see release notes).
452-
* `GridStackOptions.subGrid` -> `GridStackOptions.subGridOpts` rename
453-
* We now have `GridStackWidget.subGridOpts` vs `GridStackNode.subGrid` (was `subGrid` with both types which is error prone)
439+
* `GridStackOptions.subGrid` -> `GridStackOptions.subGridOpts` rename. We now have `GridStackWidget.subGridOpts` vs `GridStackNode.subGrid` (was both types which is error prone)
454440
* `GridStackOptions.addRemoveCB` -> `GridStack.addRemoveCB` is now global instead of grid option
455-
* removed `GridStackOptions.dragInOptions` since `setupDragIn()`has it replaced since 4.0
441+
* removed `GridStackOptions.dragInOptions` since `GridStack.setupDragIn()` has it replaced since 4.0
456442
* remove `GridStackOptions.minWidth` obsolete since 5.1, use `oneColumnSize` instead
443+
* CSS rules removed `.grid-stack` prefix for anything already gs based, 12 column (default) now uses `.grid-stack-12`, `gs-min|max_w|h` attribute no longer written (but read)
457444
458445
# jQuery Application
459446
@@ -501,4 +488,4 @@ View our change log [here](https://github.com/gridstack/gridstack.js/tree/master
501488
502489
# The Team
503490
504-
gridstack.js is currently maintained by [Alain Dumesny](https://github.com/adumesny) and [Dylan Weiss](https://github.com/radiolips), originally created by [Pavel Reznikov](https://github.com/troolee). We appreciate [all contributors](https://github.com/gridstack/gridstack.js/graphs/contributors) for help.
491+
gridstack.js is currently maintained by [Alain Dumesny](https://github.com/adumesny), before that [Dylan Weiss](https://github.com/radiolips), originally created by [Pavel Reznikov](https://github.com/troolee). We appreciate [all contributors](https://github.com/gridstack/gridstack.js/graphs/contributors) for help.

doc/CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Change log
9696
* fix: [#2234](https://github.com/gridstack/gridstack.js/issues/2234) `Utils.getElements('1')` (called by removeWidget() and others) now checks for digit 'selector' (becomes an id).
9797
* fix: [#2213](https://github.com/gridstack/gridstack.js/issues/2213) `destroy()` now removes event handlers too
9898
* feat: [#2292](https://github.com/gridstack/gridstack.js/issues/2292) ne nw resize handle
99-
* break: (meant to be in v8) removed `GridStackOptions.dragInOptions` since `setupDragIn()`has it replaced since 4.0
99+
* break: (meant to be in v8) removed `GridStackOptions.dragInOptions` since `GridStack.setupDragIn()`has it replaced since 4.0
100100

101101
## 8.0.0 (2023-04-29)
102102
* package is now ES2020 (TS exported files), webpack all.js still umd (better than commonjs for browsers), still have es5/ files unchanged (for now)

0 commit comments

Comments
 (0)