r88735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88734‎ | r88735 | r88736 >
Date:18:50, 24 May 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
bugfix: "Add Another" crashed JS
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SemanticForms.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SemanticForms.js
@@ -655,7 +655,7 @@
656656 // register initialization and validation methods for new inputs
657657
658658 var sfdata = jQuery("#sfForm").data('SemanticForms');
659 - if (sfdata) { // found data object?
 659+ if ( sfdata && sfdata.initFunctions[old_id] ) { // found data object?
660660
661661 // For every initialization method for
662662 // input with id old_id, register the
@@ -735,7 +735,7 @@
736736 if (this.id) {
737737
738738 var sfdata = jQuery("#sfForm").data('SemanticForms');
739 - if (sfdata) { // if anything registered at all
 739+ if ( sfdata && sfdata.initFunctions[this.id] ) { // if anything registered at all
740740 // Call every initialization method
741741 // for this input
742742 for ( var i = 0; i < sfdata.initFunctions[this.id].length; i++ ) {