Author: jablko
Date: Mon Oct 18 11:02:56 2010
New Revision: 8232

Log:
Global no longer necessary, use closure

Modified:
   
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
   
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php
   
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php

Modified: 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
==============================================================================
--- 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
       Mon Oct 18 10:56:04 2010        (r8231)
+++ 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
       Mon Oct 18 11:02:56 2010        (r8232)
@@ -58,7 +58,7 @@
   attach: function (context)
     {
       // Define dialog
-      Qubit.dialogRelatedEntity = new QubitDialog('relatedEntity', {
+      var dialog = new QubitDialog('relatedEntity', {
         'displayTable': 'relatedEntityDisplay',
         'newRowTemplate': '$rowTemplate',
         'handleFieldRender': handleFieldRender }, jQuery);
@@ -66,15 +66,14 @@
       // Add edit link/icon to "relatedFunctions" rows
       jQuery('#relatedEntityDisplay tr').each(function ()
         {
-          var thisUri = this.id;
-          if (undefined != thisUri)
+          if (undefined != this.id)
           {
             jQuery('<a href="#">$editImage</a>')
               .click(function (event)
                 {
                   event.preventDefault();
 
-                  Qubit.dialogRelatedEntity.open(thisUri);
+                  dialog.open(this.id);
                 })
               .prependTo('td:last', this);
           }

Modified: 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php
==============================================================================
--- 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php  
    Mon Oct 18 10:56:04 2010        (r8231)
+++ 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php  
    Mon Oct 18 11:02:56 2010        (r8232)
@@ -133,7 +133,7 @@
         }
 
       // Define dialog
-      Qubit.dialog = new QubitDialog('functionRelation', {
+      var dialog = new QubitDialog('functionRelation', {
         'displayTable': 'relatedFunctions',
         'newRowTemplate': '$rowTemplate',
         'handleFieldRender': handleFieldRender,
@@ -142,15 +142,14 @@
       // Add edit link/icon to "relatedFunctions" rows
       jQuery('#relatedFunctions tr').each(function ()
         {
-          var thisUri = this.id;
-          if (undefined != thisUri)
+          if (undefined != this.id)
           {
             jQuery('<a href="#">$editImage</a>')
               .click(function (event)
                 {
                   event.preventDefault();
 
-                  Qubit.dialog.open(thisUri);
+                  dialog.open(this.id);
                 })
               .prependTo('td:last', this);
           }

Modified: 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php
==============================================================================
--- 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php  
    Mon Oct 18 10:56:04 2010        (r8231)
+++ 
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php  
    Mon Oct 18 11:02:56 2010        (r8232)
@@ -58,7 +58,7 @@
   attach: function (context)
     {
       // Define dialog
-      Qubit.dialog2 = new QubitDialog('relatedResource', {
+      var dialog = new QubitDialog('relatedResource', {
         'displayTable': 'relatedResourceDisplay',
         'newRowTemplate': '$rowTemplate',
         'handleFieldRender': handleFieldRender }, jQuery);
@@ -66,15 +66,14 @@
       // Add edit link/icon to "relatedFunctions" rows
       jQuery('#relatedResourceDisplay tr').each(function ()
         {
-          var thisUri = this.id;
-          if (undefined != thisUri)
+          if (undefined != this.id)
           {
             jQuery('<a href="#">$editImage</a>')
               .click(function (event)
                 {
                   event.preventDefault();
 
-                  Qubit.dialog2.open(thisUri);
+                  dialog.open(this.id);
                 })
               .prependTo('td:last', this);
           }

-- 
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.

Reply via email to