-
Notifications
You must be signed in to change notification settings - Fork 30
alternative fix for 'overlay only works once' #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
handle closing dialog from overlay properly: don't call overlay.hide() if we are hiding dialog as a result of overlay being hidden fixes #21
It seems that it works well, but honestly I don’t like an extra state |
@pirxpilot we have to make up a decision on that) |
I don’t mind merging any of PR, providing that overlay is also fixed. Decide to yourself which solution looks simpler and clearer ) |
add showOverlay method (since we already had hideOverlay method) hide/showOverlay are responsible for making sure that overlay is only shown/hiddent once per cycle regardless of how we close the dialog
Yup - |
It works. IMO that new version looks more obscure than is was initially. Factually some new hidden state is defined via Dialog.prototype.show = function(){
var overlay = this._overlay;
this.showOverlay();
//↑ok, but why showOverlay if I have not defined it for my instance?
//Where is the check of it’s flag?
//Probably within this.showOverlay.
//But at least that is unnecessary call then.
//Ok, I see `if (!self._overlayOptions) return;` in showOverlay
//so probably overlay is defined via this._overlayOptions.
if (!overlay || overlay.closable) this.escapable();
//here the state of overlay is checked via this._overlay
//so what is the overlay flag - this._overlayOptions or this._overlay? Such confusion makes things very difficult to track and understand. The only critical thing here seems to be in No offense, but I like it lesser than your previous hidden state version, it is too verbose ) |
Could you elaborate on that. I don't think we changed any public/documented API but maybe I am missing something. RE: creating/destroying overlay every time: I don't see any other obvious way of supporting dialog reuse - #30 does not really work well when dialog is closed (multiple times) from the close button. Let's give a day or two for other contributor comments though before squashing this branch and taking PR into master. |
Code looks good, but I haven’t tried or tested this at all. |
@pirxpilot so are we going to merge it? |
alternative fix for 'overlay only works once'
Alright, just did :-) |
fixes #21
alternative to #30