changeset 6:e3f85c9247b7

Put the links in a right sidebar. This is probably highly controversial and should at least be controlled by a pref, but its "needed" by the customer.
author Franck Deroche <franck@defr.org>
date Mon, 26 Jan 2009 15:09:55 +0100
parents 4fc2f22efcdf
children 281e131cb6c3
files noderef_view.css noderef_view.js noderef_view.module
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/noderef_view.css	Mon Jan 26 15:09:55 2009 +0100
@@ -0,0 +1,4 @@
+.noderef-view-items {
+  float: left;
+  margin-right: 15px;
+}
--- a/noderef_view.js	Mon Jan 26 14:59:57 2009 +0100
+++ b/noderef_view.js	Mon Jan 26 15:09:55 2009 +0100
@@ -3,6 +3,7 @@
  * Attach the noderef_view behavior.
  */
 Drupal.behaviors.noderef_view = function(context) {
+  $('.noderef-view-wrapper div[id$="-wrapper"]:first-child').addClass('noderef-view-items');
   $('.noderef_view_link', context).each(function(i, obj) {
     $(obj).addClass('noderef_view_link_processed').click(function() {
       // Get the wrapper
--- a/noderef_view.module	Mon Jan 26 14:59:57 2009 +0100
+++ b/noderef_view.module	Mon Jan 26 15:09:55 2009 +0100
@@ -68,8 +68,10 @@
     if ($alter) {
       // We've changed the form, add the JS-behavior and Views CSS
       // (the latter to deal with exposed filters in the popup)
+      $path = drupal_get_path('module', 'noderef_view');
+      drupal_add_js($path .'/noderef_view.js');
+      drupal_add_css($path .'/noderef_view.css');
       drupal_add_css(drupal_get_path('module', 'views') .'/css/views.css');
-      drupal_add_js(drupal_get_path('module', 'noderef_view') .'/noderef_view.js');
     }
   }
   elseif ($form_id == 'views_exposed_form' && isset($_GET['destination'])) {
@@ -122,7 +124,7 @@
 
 function noderef_view_add_link($form_element) {
   $form_element['#prefix'] = "<div class='noderef-view-wrapper'>" . $form_element['#prefix'];
-  $form_element['#suffix'] .= $form_element['#links'] . '<span class="clear"></span></div>';
+  $form_element['#suffix'] .= $form_element['#noderef_view_link'] . '<span class="clear-block"></span></div>';
   return $form_element;
 }