Author: jablko
Date: Thu Oct 21 21:37:14 2010
New Revision: 8362
Log:
Keep .form in jQuery instance
Modified:
trunk/js/dialog.js
Modified: trunk/js/dialog.js
==============================================================================
--- trunk/js/dialog.js Thu Oct 21 21:34:33 2010 (r8361)
+++ trunk/js/dialog.js Thu Oct 21 21:37:14 2010 (r8362)
@@ -5,7 +5,7 @@
QubitDialog = function (table, options)
{
this.table = document.getElementById(table);
- this.form = $(this.table).closest('form')[0]; // Parent form
+ this.$form = $(this.table).closest('form'); // Parent form
this.instances = 0; // Counter
this.label = $('caption', this.table).remove().text();
this.fields = [];
@@ -174,7 +174,7 @@
}
// Bind onSubmit method
- $(this.form).submit(this.onSubmit);
+ this.$form.submit(this.onSubmit);
// Wait for all iframes to finish before submitting main form
this.done = function ()
@@ -566,7 +566,7 @@
if (null != id && 'new' !== id.substr(0,3))
{
var name = outputPrefix + '[' + i + '][id]';
- $(this.form).append('<input type="hidden" name="' + name + '"
value="' + id + '"/>');
+ this.$form.append('<input type="hidden" name="' + name + '"
value="' + id + '"/>');
}
// Convert all event data into hidden input fields
@@ -584,7 +584,7 @@
}
var $hidden = $('<input type="hidden" name="' + name + '"
value="' + thisData[j] + '"/>');
- $hidden.appendTo(this.form);
+ $hidden.appendTo(this.$form);
// Update this value from iframe
for (var k in this.iframes)
@@ -609,7 +609,7 @@
// Delete relations that have been removed
for (var k=0; k < this.deletes.length; k++)
{
- $(this.form).append('<input type="hidden"
name="deleteRelations[' + this.deletes[k] + ']" value="delete"/>');
+ this.$form.append('<input type="hidden" name="deleteRelations['
+ this.deletes[k] + ']" value="delete"/>');
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.