Skip to content
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

Added extra line to allow clicking outside of modal dialog to allow exit #113

Merged
merged 4 commits into from
Jul 20, 2012

Conversation

joelbaranowski
Copy link
Contributor

Just some extra functionality to make dialog boxes less cumbersome,

@jpslav
Copy link
Member

jpslav commented Jun 28, 2012

It is minor but this is a bit of code duplication.

To eliminate it, just add a new, custom function to jQuery, like you will see in assets/javascripts/jquery_extensions.js.

This should be a "closeOnClickOutside" method or similar, e.g.

jQuery.fn.exists = function(){
  $('.ui-widget-overlay').live("click",function(){
    jQuery(this).dialog("close");
  });
}

I don't know if this is exactly it or not, but it should be close. Then all of your copied codes look like:

$("#dev_toolbox_dialog").dialog('open').closeOnClickOutside();

@jpslav
Copy link
Member

jpslav commented Jul 4, 2012

Hey @joelbaranowski, can you please make the change in my comment from 6 days ago and then I can merge.

@joelbaranowski
Copy link
Contributor Author

oh yes, sorry forgot to ask you about that was busy working on something else. But your suggested solution didn't seem to work. Tried several variations but wasn't able to get it to work. The only other function in there isn't quite close enough for me to work off it, and the internet wasn't very helpful. Do you have any other ideas how to get the function to work in extensions?

@Dantemss
Copy link
Member

@joelbaranowski
Copy link
Contributor Author

dante got it in one, problem with jquery(this) not being the dialog element. Will push and be ready to go.

@Dantemss
Copy link
Member

@jpslav joel showed this to me and it seems to be working, with the change you requested

jpslav added a commit that referenced this pull request Jul 20, 2012
Added extra line to allow clicking outside of modal dialog to allow exit.
@jpslav jpslav merged commit 034992a into lml:master Jul 20, 2012
@jpslav
Copy link
Member

jpslav commented Jul 20, 2012

Thanks @joelbaranowski!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants