/[drupal]/contributions/modules/editablefields/editablefields.js
ViewVC logotype

Diff of /contributions/modules/editablefields/editablefields.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.4, Wed Dec 31 16:31:05 2008 UTC revision 1.1.2.5, Thu Jan 1 12:20:59 2009 UTC
# Line 1  Line 1 
1  // $Id: editablefields.js,v 1.1.2.3 2008/12/31 12:46:58 markfoodyburton Exp $  // $Id: editablefields.js,v 1.1.2.4 2008/12/31 16:31:05 markfoodyburton Exp $
2    
3  Drupal.behaviors.editablefields = function(context) {  Drupal.behaviors.editablefields = function(context) {
   
4    $('div.editablefields',context).not('.noonload').each(function() {    $('div.editablefields',context).not('.noonload').each(function() {
5      $(this).children().css('opacity', '0.3');                                                            $(this).children().css('opacity', '0.3');
6      editablefieldsload(this, Drupal.settings.basePath+"?q=/editablefields_html/" + $(this).attr("nid") + "/" + $(this).attr("field"));                                                            editablefieldsload(this, Drupal.settings.basePath+"?q=/editablefields_html/" + $(this).attr("nid") + "/" + $(this).attr("field"));
7    });                                                          });
8    $('div.editablefields',context).change(editablefieldschanger);    $('div.editablefields',context).change(editablefieldschanger);
9    $('div.editablefields',context).submit(editablefieldschanger);    $('div.editablefields',context).submit(editablefieldschanger);
10    
11    
12    var updateValue;    var updateValue;
13    
14    function editablefieldsupdater(element) {    function editablefieldsupdater(element) {
15      var nid=$(element).attr("nid");      var nid=$(element).attr("nid");
16        var field=$(element).attr("field");
17      $(element).children().css('opacity', '0.3');      $(element).children().css('opacity', '0.3');
18      $.ajax({      $.ajax({
19      type: "POST",      type: "POST",
20            url: "?q=/editablefields_submit",            url: "?q=/editablefields_submit",
21            data: $(element).find('form').serialize()+"&nid="+nid,            data: $(element).find('form').serialize()+"&nid="+nid+"&field="+field,
22            element: $(element),            element: $(element),
23            success: function(msg) {            success: function(msg) {
24            updateValue = 0;            updateValue = 0;
# Line 61  Drupal.behaviors.editablefields = functi Line 61  Drupal.behaviors.editablefields = functi
61      }      }
62    
63      newValue = $(t).find('form').serialize();      newValue = $(t).find('form').serialize();
64    
65  // all this does is prevent you from submitting the same data twice... If in the  // all this does is prevent you from submitting the same data twice... If in the
66  // meantime the user hits a different button, then, I guess the user knows what  // meantime the user hits a different button, then, I guess the user knows what
67  // they want.  // they want.

Legend:
Removed from v.1.1.2.4  
changed lines
  Added in v.1.1.2.5

  ViewVC Help
Powered by ViewVC 1.1.2