WebCabin / wcDocker

wcDocker (Web Cabin Docker) is a powerful window layout system with a responsive and completely interactive design. Move, remove, create, and duplicate panel windows at any time! Organize how you wish! View the demo here:
http://docker.webcabin.org
146 stars 53 forks source link

Provide dynamic options via addPanel #116

Closed serkanserttop closed 7 years ago

serkanserttop commented 7 years ago

Any reason why this line https://github.com/WebCabin/wcDocker/blob/cef106512d1c125bd40a6612d7a107912d64100a/Code/docker.js#L326

is not the below? panel._panelObject = new panelType.options.onCreate(panel, panelOptions, options);

Then onCreate function's arguments would be (panel, options, dynamicOptions). I can call wcDockerInstance.addPanel('panelType', wcDocker.DOCK.STACKED, parent, {id: 'xyz'});

I believe this must be a common pattern and I am confused why people are not complaining about this. Am I missing something?

FYI, I am new to the library, so I apologize if I misunderstood something.

serkanserttop commented 7 years ago

Just to note, couple lines above in __addPanel function, options are passed in: https://github.com/WebCabin/wcDocker/blob/cef106512d1c125bd40a6612d7a107912d64100a/Code/docker.js#L293 https://github.com/WebCabin/wcDocker/blob/cef106512d1c125bd40a6612d7a107912d64100a/Code/docker.js#L295

serkanserttop commented 7 years ago

Similar discussion in https://github.com/WebCabin/wcDocker/issues/77

serkanserttop commented 7 years ago

@xblox Thanks for the answer.