@@ -75,10 +75,10 @@ export class GridStack {
7575 let el = GridStack . getGridElement ( elOrString ) ;
7676 if ( ! el ) {
7777 if ( typeof elOrString === 'string' ) {
78- console . log ( 'gridstack.js: init () no grid was found. Did you forget class ' + elOrString + ' on your element ?' +
79- '\n ".grid-stack" is required for proper CSS styling and drag/drop.' ) ;
78+ console . error ( 'GridStack.initAll () no grid was found with selector " ' + elOrString + '" - element missing or wrong selector ?' +
79+ '\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector .' ) ;
8080 } else {
81- console . log ( 'gridstack.js: init() no grid element was passed.') ;
81+ console . error ( 'GridStack. init() no grid element was passed.') ;
8282 }
8383 return null ;
8484 }
@@ -106,8 +106,8 @@ export class GridStack {
106106 grids . push ( el . gridstack ) ;
107107 } ) ;
108108 if ( grids . length === 0 ) {
109- console . log ( 'gridstack.js: initAll() no grid was found. Did you forget class ' + selector + ' on your element ?' +
110- '\n ".grid-stack" is required for proper CSS styling and drag/drop.' ) ;
109+ console . error ( 'GridStack. initAll() no grid was found with selector " ' + selector + '" - element missing or wrong selector ?' +
110+ '\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector .' ) ;
111111 }
112112 return grids ;
113113 }
@@ -1704,18 +1704,11 @@ export class GridStack {
17041704 }
17051705 /** @internal */
17061706 private static getGridElement ( els : string | HTMLElement = '.grid-stack' ) : GridHTMLElement {
1707- return ( typeof els === 'string' ?
1708- ( document . querySelector ( els ) || document . querySelector ( '#' + els ) || document . querySelector ( '.' + els ) ) : els ) ;
1707+ return ( typeof els === 'string' ? document . querySelector ( els ) : els ) ;
17091708 }
17101709 /** @internal */
17111710 private static getGridElements ( els : string | HTMLElement = '.grid-stack' ) : GridHTMLElement [ ] {
1712- if ( typeof els === 'string' ) {
1713- let list = document . querySelectorAll ( els ) ;
1714- if ( ! list . length ) { list = document . querySelectorAll ( '.' + els ) }
1715- if ( ! list . length ) { list = document . querySelectorAll ( '#' + els ) }
1716- return Array . from ( list ) as GridHTMLElement [ ] ;
1717- }
1718- return [ els ] ;
1711+ return ( typeof els === 'string' ) ? Array . from ( document . querySelectorAll ( els ) ) : [ els ] ;
17191712 }
17201713
17211714 /** @internal initialize margin top/bottom/left/right and units */
0 commit comments