File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
123123
124124 // see if we already have a node with widget/height and check for attributes
125125 let node = el . gridstackNode || { } ;
126- if ( ! node . width || ! node . height ) {
126+ if ( el . getAttribute && ( ! node . width || ! node . height ) ) {
127127 let w = parseInt ( el . getAttribute ( 'data-gs-width' ) ) ;
128128 if ( w > 0 ) { node . width = w ; }
129129 let h = parseInt ( el . getAttribute ( 'data-gs-height' ) ) ;
@@ -180,6 +180,7 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
180180 }
181181
182182 let node = el . gridstackNode ; // use existing placeholder node as it's already in our list with drop location
183+ if ( ! node ) { return false ; }
183184 const _id = node . _id ;
184185 this . engine . cleanupNode ( node ) ; // removes all internal _xyz values (including the _id so add that back)
185186 node . _id = _id ;
Original file line number Diff line number Diff line change @@ -1129,7 +1129,7 @@ export class GridStack {
11291129 // check for css min height
11301130 let cssMinHeight = parseInt ( getComputedStyle ( this . el ) [ 'min-height' ] ) ;
11311131 if ( cssMinHeight > 0 ) {
1132- let minRow = Math . round ( cssMinHeight / this . getCellHeight ( true ) ) ;
1132+ let minRow = Math . round ( cssMinHeight / this . getCellHeight ( true ) ) ;
11331133 if ( row < minRow ) {
11341134 row = minRow ;
11351135 }
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export class Utils {
7676 if ( els [ 0 ] === '#' ) {
7777 return document . getElementById ( els . substring ( 1 ) ) ;
7878 }
79- if ( els [ 0 ] === '.' ) {
79+ if ( els [ 0 ] === '.' || els [ 0 ] === '[' ) {
8080 return document . querySelector ( els ) ;
8181 }
8282
You can’t perform that action at this time.
0 commit comments