r13402 - in MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk: docs src/archetypes/referencebrowserwidget/skins/referencebrowser

"Carsten Senger" <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.cvs
Message-ID <[email protected]>
Author: csenger
Date: Sun Jan  9 22:27:56 2011
New Revision: 13402

Modified:
   MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/docs/CHANGES.txt
   MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/skins/referencebrowser/referencebrowser.js
Log:
Don't disable checkboxes in overlay when an item is selected.
Remove the item from the value list when it is unchecked in
the value list. Partly fixes http://dev.plone.org/plone/ticket/10786


Modified: MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/docs/CHANGES.txt
==============================================================================
--- MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/docs/CHANGES.txt	(original)
+++ MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/docs/CHANGES.txt	Sun Jan  9 22:27:56 2011
@@ -4,6 +4,11 @@
 2.2 - Unreleased
 ----------------
 
+* Don't disable checkboxes in overlay when an item is selected.
+  Remove the item from the value list when it is unchecked in
+  the value list. Partly fixes http://dev.plone.org/plone/ticket/10786
+  [csenger]
+
 2.1 - 2011-01-03
 ----------------
 

Modified: MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/skins/referencebrowser/referencebrowser.js
==============================================================================
--- MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/skins/referencebrowser/referencebrowser.js	(original)
+++ MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/skins/referencebrowser/referencebrowser.js	Sun Jan  9 22:27:56 2011
@@ -20,7 +20,7 @@
            disablecurrentrelations(widget_id);
        }});
 
-  // the breadcrumb-links and the links of the 'tree'-navigation
+  // the breadcrumb-links and the links of the 'tree'-navigati        on
   jq('[id^=atrb_] a.browsesite').live('click', function(event) {
       var target = jq(this);
       var src = target.attr('href');
@@ -48,14 +48,19 @@
       var tablerow = target.parent().parent();
       var title = tablerow.find('strong').html();
       var uid = target.attr('rel');
-      refbrowser_setReference('ref_browser_' + fieldname, uid, title, parseInt(multi));
+      if (this.checked === true) {
+          refbrowser_setReference('ref_browser_' + fieldname,
+                                  uid, title, parseInt(multi));
+          }
+      else {
+          refbrowser_delReference('ref_browser_' + fieldname, uid);
+      }
       if (close_window === '1') {
           overlay = jq('div#content').data('overlay');
           overlay.close();
       } else {
           showMessage(title);
       };
-      jq(this).attr('disabled', 'disabled');
       });
 
 
@@ -194,6 +199,11 @@
     }
 }
 
+
+function refbrowser_delReference(widget_id, uid) {
+    jq('#' + widget_id + ' input[value="' + uid + '"]').closest('li').remove()
+}
+
 // function to clear the reference field or remove items
 // from the multivalued reference list.
 function refbrowser_removeReference(widget_id, multi)
@@ -343,9 +353,10 @@
 function refreshOverlay(wrap, srcfilter, newoption) {
     var oldhistory = jq('[id^=atrb_] form#history select');
     wrap.load(srcfilter, function() {
-        jq('[id^=atrb_] form#history select').append(newoption + oldhistory.html());
+        jq('[id^=atrb_] form#history select').append(newoption +
+                                                     oldhistory.html());
         ov = jq('div#content').data('overlay');
         widget_id = ov.getTrigger().attr('rel').substring(6);
-        disablecurrentrelations(widget_id);
+//        disablecurrentrelations(widget_id);
         });
 }

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.