Hi,
am unable to find the maximise event trigger can someone help on these please
I think a lot of events aren't documented, so in that case the best approach is to search inside goldenlayout.js for .emit, and you can find all the events that are triggered throughout the library.
In this case, I found the maximised event, which is triggered on the stack which is maximised. Hope that helps!
Easiest way to capture maximise/ minimize events is to attach a click method on stack creation, example code will look like below
myLayout.on( 'stackCreated', function( stack ){
stack
.header
.controlsContainer
.find( '.lm_maximise' ) //get the maximise icon
.click(function(){
//Get maximise and minimise events here
});
});
Thank you Ram Yadlapalli Its Working
@Raviraj531 , Please close the issue if it is resolved
@asialgearoid maximised event is package private.
Maximising a tab throws stateChangedevent, so you could listen to this or attach your own clickListener like @RamYadlapalli suggested.
@malled I've implemented the solution, for click of close icon, as suggested by @RamYadlapalli
However that code is getting called multiple times equals to number of stack present in the GL. If there are 4 stacks, clicking on close button on any of the stack call the clickListener code 4 times.
What worked for me was this ...
myLayout.on("stackCreated", (stack) => {
const maximizeElement = stack.element.find(".lm_maximise")[0];
stack.on("maximised", () => {
console.log("is maximized here");
});
stack.on("minimised", () => {
console.log("is minimized here");
});
});
Most helpful comment
Easiest way to capture maximise/ minimize events is to attach a click method on stack creation, example code will look like below