ivaynberg commented on issue #361: WICKET-6666 initial checkin of new ModalDialog URL: https://github.com/apache/wicket/pull/361#issuecomment-492294684 > Thanks Igor, it's much easier to start with something instead of starting from scratch. > > I would like to improve some general points: > > * body>overlay>form>content > ModalDialog replicates what ModalWindow has done: its JS creates some wrapping HTML, moves the dialog's content inside of it and appends everything to the body. I think it would be simpler to leave the dialog where it is in the DOM: then we don't have to create markup from JS, no extra form is required and it works without JavaScript too (yes, call me old-school). that is what i started with, but i quickly ran into all sorts of zindex and other problems with more complex layouts. unfortunately there is no substitute for being the last child of body yet. > * behaviors > ModalDialog has its own pure-JS 'behavior' solution. We can make these Wicket-behaviors, so they are modular and reuasable: some projects will not need all of them, want to replace them with their own or add custom ones (e.g. resizing). im not sure these should be refactored into wicket Behaviors, these are only there to keep the code easy to understand since most things happen in open/close having everything there was messy. and they have lifecycles specific to the modal. if customization is required we could move the behaviors array into options and allow users to provide their own > * styling > ModalDialog offers sort of a default skin: I'd like to make this a behavior with a base CSS selector (similar to 'themes' of Palette and AbstractTree) - this makes it possible to use different styles on a single page simultaneously (e.g. a simple warning dialog vs. an larger one with an input form). i am not sure how necessary this is. unlike the old modal window, this one contains nothing in its body, so you can already create different title bars for warnings/errors/other dialogs by plopping a different panel into the content. the only thing that the css provides is the look and feel of the mask and borders which i dont think would change based on your usecase. but, i do not feel strongly about it so feel free to tweak, the code is in a branch. my only word of caution is that a big reason why the old modal window was such a mess and so hard to maintain is because we put a ton of features into it that only a small percentage of people used, i would try to keep this one as thin as possible. > * multiple/nested dialogs > Many elements are modified via CSS class selector, we'll have to improve that to support multiple dialogs. most selectors are used downstream of the overlay element, since each overlay will be a direct child of body i dont think there will be collissions... maybe i am wrong > * options.console > IMHO we can simply call Wicket.Log.* (see recent "js-cleanup" discussion) feel free to make this change, we should also remove it from options then...
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
