@@ -72,7 +72,7 @@ export class GridStack {
7272 return null ;
7373 }
7474 if ( ! el . gridstack ) {
75- el . gridstack = new GridStack ( el , options ) ;
75+ el . gridstack = new GridStack ( el , Utils . clone ( options ) ) ;
7676 }
7777 return el . gridstack
7878 }
@@ -152,14 +152,11 @@ export class GridStack {
152152 obsoleteAttr ( this . el , 'data-gs-height' , 'data-gs-max-row' , 'v0.5.3' ) ;
153153 obsoleteAttr ( this . el , 'data-gs-current-height' , 'data-gs-current-row' , 'v1.0.0' ) ;
154154
155- opts . itemClass = opts . itemClass || 'grid-stack-item' ;
156-
157155 // if row property exists, replace minRow and maxRow instead
158156 if ( opts . row ) {
159157 opts . minRow = opts . maxRow = opts . row ;
160158 delete opts . row ;
161159 }
162-
163160 let rowAttr = Utils . toNumber ( el . getAttribute ( 'data-gs-row' ) ) ;
164161
165162 // elements attributes override any passed options (like CSS style) - merge the two together
@@ -180,29 +177,28 @@ export class GridStack {
180177 staticGrid : false ,
181178 _class : 'grid-stack-instance-' + ( Math . random ( ) * 10000 ) . toFixed ( 0 ) ,
182179 animate : Utils . toBool ( el . getAttribute ( 'data-gs-animate' ) ) || false ,
183- alwaysShowResizeHandle : opts . alwaysShowResizeHandle || false ,
184- resizable : Utils . defaults ( opts . resizable || { } , {
180+ alwaysShowResizeHandle : false ,
181+ resizable : {
185182 autoHide : ! ( opts . alwaysShowResizeHandle || false ) ,
186183 handles : 'se'
187- } ) ,
188- draggable : Utils . defaults ( opts . draggable || { } , {
189- handle : ( opts . handleClass ? '.' + opts . handleClass : ( opts . handle ? opts . handle : '' ) ) ||
190- '.grid-stack-item-content' ,
184+ } ,
185+ draggable : {
186+ handle : ( opts . handleClass ? '.' + opts . handleClass : ( opts . handle ? opts . handle : '' ) ) || '.grid-stack-item-content' ,
191187 scroll : false ,
192188 appendTo : 'body'
193- } ) ,
194- disableDrag : opts . disableDrag || false ,
195- disableResize : opts . disableResize || false ,
189+ } ,
190+ disableDrag : false ,
191+ disableResize : false ,
196192 rtl : 'auto' ,
197193 removable : false ,
198- removableOptions : Utils . defaults ( opts . removableOptions || { } , {
194+ removableOptions : {
199195 accept : '.' + opts . itemClass
200- } ) ,
196+ } ,
201197 removeTimeout : 2000 ,
202198 verticalMarginUnit : 'px' ,
203199 cellHeightUnit : 'px' ,
204- disableOneColumnMode : opts . disableOneColumnMode || false ,
205- oneColumnModeDomSort : opts . oneColumnModeDomSort
200+ disableOneColumnMode : false ,
201+ oneColumnModeDomSort : false
206202 } ;
207203
208204 this . opts = Utils . defaults ( opts , defaults ) ;
0 commit comments