MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / _widthOrContainer

Method _widthOrContainer

src/gridstack.ts:955–959  ·  view source on GitHub ↗

return our expected width (or parent) , and optionally of window for dynamic column check

(forBreakpoint = false)

Source from the content-addressed store, hash-verified

953
954 /** return our expected width (or parent) , and optionally of window for dynamic column check */
955 protected _widthOrContainer(forBreakpoint = false): number {
956 // use `offsetWidth` or `clientWidth` (no scrollbar) ?
957 // https://stackoverflow.com/questions/21064101/understanding-offsetwidth-clientwidth-scrollwidth-and-height-respectively
958 return forBreakpoint && this.opts.columnOpts?.breakpointForWindow ? window.innerWidth : (this.el.clientWidth || this.el.parentElement.clientWidth || window.innerWidth);
959 }
960
961 /** checks for dynamic column count for our current size, returning true if changed */
962 protected checkDynamicColumn(): boolean {

Callers 2

cellWidthMethod · 0.95
checkDynamicColumnMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected