You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
cleanup
- move some methods to ResizeItem subclass - allow distributor to instanciate sizer and resizeitem it needs through static factory methods, instead of passing in another ctor a distributor can only function with the right item and sizer anyways. - use consistent import/export style - remove obsolete code
This commit is contained in:
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
implements DOM/CSS operations for resizing.
|
||||
The sizer determines what CSS mechanism is used for sizing items, like flexbox, ...
|
||||
*/
|
||||
export class Sizer {
|
||||
export default class Sizer {
|
||||
constructor(container, vertical, reverse) {
|
||||
this.container = container;
|
||||
this.reverse = reverse;
|
||||
@@ -86,10 +86,3 @@ export class Sizer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class FlexSizer extends Sizer {
|
||||
setItemSize(item, size) {
|
||||
item.style.flexGrow = `0`;
|
||||
item.style.flexBasis = `${Math.round(size)}px`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user