From 431cf675f12c79c009c368f8afcbd40c771bc21f Mon Sep 17 00:00:00 2001 From: Dylan Weiss Date: Sun, 17 Sep 2017 15:22:08 -0400 Subject: [PATCH] Update documentation and force x/y coords to be stores as ints. --- doc/CHANGES.md | 7 +++++-- src/gridstack.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 924d1bf78..d347819ff 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -23,9 +23,12 @@ Change log - widgets can have their own resize handles. Use `data-gs-resize-handles` element attribute to use. For example, `data-gs-resize-handles="e,w"` will make the particular widget only resize west and east. ([#494](https://github.com/troolee/gridstack.js/issues/494)). - enable sidebar items to be duplicated properly. Pass `helper: 'clone'` in `draggable` options. ([#661](https://github.com/troolee/gridstack.js/issues/661), ([#396](https://github.com/troolee/gridstack.js/issues/396), ([#499](https://github.com/troolee/gridstack.js/issues/499)). - fix `staticGrid` grid option ([#743](https://github.com/troolee/gridstack.js/issues/743)) -- preserve inline styles when moving/cloning items (thanks silverwind) +- preserve inline styles when moving/cloning items (thanks [@silverwind](https://github.com/silverwind)) - fix bug causing heights not to get set ([#744](https://github.com/troolee/gridstack.js/issues/744)) -- allow grid to have min-height, fixes ([#628](https://github.com/troolee/gridstack.js/issues/628)) +- allow grid to have min-height, fixes ([#628](https://github.com/troolee/gridstack.js/issues/628)) (thanks [@adumesny](https://github.com/adumesny)) +- widget x and y are now ints (thanks [@DonnchaC](https://github.com/donnchac)) +- allow all droppable options (thanks [@vigor-vlad](https://github.com/vigor-vlad)) +- properly track mouse position in `getCellFromPixel` (thanks [@aletorrado](https://github.com/aletorrado)) ## v0.3.0 (2017-04-21) diff --git a/src/gridstack.js b/src/gridstack.js index f2fb18d1f..351f6764a 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1272,8 +1272,8 @@ el.addClass(this.opts.itemClass); var node = self.grid.addNode({ - x: el.attr('data-gs-x'), - y: el.attr('data-gs-y'), + x: parseInt(el.attr('data-gs-x'), 10), + y: parseInt(el.attr('data-gs-y'), 10), width: el.attr('data-gs-width'), height: el.attr('data-gs-height'), maxWidth: el.attr('data-gs-max-width'),