r84184 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84183‎ | r84184 | r84185 >
Date:17:23, 17 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Small fixes to the Javascript
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php
@@ -108,23 +108,25 @@
109109 jQuery('#fieldsList').append(newField);
110110 }
111111
112 -jQuery(".deleteField").click( function() {
113 - // Remove the encompassing div for this instance.
114 - jQuery(this).closest(".fieldBox")
115 - .fadeOut('fast', function() { jQuery(this).remove(); });
116 -});
117 -
118112 function validateCreateTemplateForm() {
119113 templateName = jQuery('#template_name').val();
120114 if (templateName == '') {
121115 scroll(0, 0);
122 - jQuery('#template_name_p').append('<font color="red">$template_name_error_str</font>');
 116+ jQuery('#template_name_p').append(' <font color="red">$template_name_error_str</font>');
123117 return false;
124118 } else {
125119 return true;
126120 }
127121 }
128 -jQuery('#createTemplateForm').submit( function() { return validateCreateTemplateForm(); } );
 122+
 123+jQuery(document).ready(function() {
 124+ jQuery(".deleteField").click( function() {
 125+ // Remove the encompassing div for this instance.
 126+ jQuery(this).closest(".fieldBox")
 127+ .fadeOut('fast', function() { jQuery(this).remove(); });
 128+ });
 129+ jQuery('#createTemplateForm').submit( function() { return validateCreateTemplateForm(); } );
 130+});
129131 </script>
130132
131133 END;