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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/assets/javascripts/jquery_extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
// License version 3 or later. See the COPYRIGHT file for details.

jQuery.fn.exists = function(){return jQuery(this).length>0;}

jQuery.fn.closeOnClickOutside = function(){
var dialogx = this;
$('.ui-widget-overlay').live("click",function(){
dialogx.dialog("close");
});
}
2 changes: 1 addition & 1 deletion app/views/dev/toolbox.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ $("#dev_toolbox_dialog").html("<%= ej(render :partial => 'toolbox' )%>");
refresh_buttons();
refresh_datetime_pickers();

$("#dev_toolbox_dialog").dialog('open');
$("#dev_toolbox_dialog").dialog('open').closeOnClickOutside();
4 changes: 2 additions & 2 deletions app/views/help/topic.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ $("#help_dialog").dialog({

<%= reload_mathjax("help_dialog") if @options[:include_mathjax] %>

$("#help_dialog").dialog('open');
$("#help_dialog").scrollTop(0);
$("#help_dialog").dialog('open').closeOnClickOutside();
$("#help_dialog").scrollTop(0);
2 changes: 1 addition & 1 deletion app/views/project_questions/attribution.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ $("#attribution_dialog").html("<%= escape_javascript(
render :partial => 'project_questions/attribution',
:locals => {:question_ids => @question_ids}) %>");

$("#attribution_dialog").dialog('open');
$("#attribution_dialog").dialog('open').closeOnClickOutside();
2 changes: 1 addition & 1 deletion app/views/questions/preview.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:locals => {:question => @question}) %>");
<%= reload_mathjax("preview_dialog") %>

$("#preview_dialog").dialog('open');
$("#preview_dialog").dialog('open').closeOnClickOutside();
<% else %>
// Submit the form so that the error messages display nicely with formatting
// around the offending entries (use the trigger approach so we don't get
Expand Down
3 changes: 1 addition & 2 deletions app/views/questions/quickview.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ $("#quickview_dialog").html("<%= escape_javascript(render :partial => 'show',
:locals => {:question => @question}) %>");
<%= reload_mathjax("quickview_dialog") %>

$("#quickview_dialog").dialog('open');

$("#quickview_dialog").dialog('open').closeOnClickOutside();
2 changes: 1 addition & 1 deletion app/views/users/action_new.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ $("#user_action_dialog").dialog({
width:600,
buttons: { "Close": function() { $(this).dialog("close"); }},
open: function(event, ui) { $("#text_query").val(''); $("#selected_type").val(''); }
});
}).closeOnClickOutside();