Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move the alias click event out of the element into a function

  • Loading branch information...
commit 3f73afa1cfaf0c9a4285409e122b082e6fe2dcc3 1 parent 46d3d03
@vmoravec vmoravec authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 plugins/administrator/app/views/administrator/index.html.erb
View
15 plugins/administrator/app/views/administrator/index.html.erb
@@ -50,11 +50,22 @@
submitHandler: function(form) {
var message = <%= jss _("Please wait") -%>;
$.modalDialog.wait( {message: message});
- //disableFormOnSubmit(message);
form.submit();
}
})
+ $("[name='save_aliases']").click(function(){
+ if ($('#adminForm').validate().element('#administrator_aliases')) {
+ $('#submit_type').val('save_aliases')
+ return true;
+ } else {
+ $('#submit_type').val('')
+ return false;
+ }
+ });
+ //, :onclick=>"$('#submit_type').val('save_aliases');return $('#adminForm').validate().element('#administrator_aliases');"
+
+
// make the error message translatable - override the default messsage
$.extend($.validator.messages, {
qualTo: <%= jss _("The passwords do not match.") -%>,
@@ -133,7 +144,7 @@
<label style="float:left; display:inline-block; width:204px; line-height:24px;"><%=_("Forward system mail to")%></label> <!-- RORSCAN_ITL -->
<%= f.text_field :aliases, :disabled => disabled, :class => "emails" %>
<% unless params.has_key? "firstboot" # during initial configuration, allow only main Save button %>
- <%= f.submit _("Save Mail Only"), :name => "save_aliases", :disabled => disabled, :onclick=>"$('#submit_type').val('save_aliases');return $('#adminForm').validate().element('#administrator_aliases');", :class=>'cancel' %>
+ <%= f.submit _("Save Mail Only"), :name => "save_aliases", :disabled => disabled, :class=>'cancel' %>
<label style="line-height:26px;" for="administrator_aliases" generated="true" class="error"></label>
<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.