minor
[myslice.git] / plugins / hazelnut / hazelnut.js
index 43bb9cc..7afc726 100644 (file)
@@ -1,8 +1,5 @@
 /**
- * MySlice Hazelnut plugin
- * URL: http://trac.myslice.info
  * Description: display a query result in a datatables-powered <table>
- * Author: The MySlice Team
  * Copyright (c) 2012 UPMC Sorbonne Universite - INRIA
  * License: GPLv3
  */
             return this.each(function() {
                 var $this = $(this);
                 /* Events */
-                $(this).on('show.Datatables', methods.show);
+                $this.on('show.Datatables', methods.show);
 
                 /* An object that will hold private variables and methods */
                var hazelnut = new Hazelnut (options);
-                $(this).data('Hazelnut', hazelnut);
+                $this.data('Hazelnut', hazelnut);
 
                 var query_channel   = '/query/' + options.query_uuid + '/changed';
                 var update_channel  = '/update-set/' + options.query_uuid;
     function Hazelnut(options) {
         /* member variables */
         this.options = options;
-        /* constructor */
-        this.table = null;
        // xxx thierry : initialize this here - it was not, I expect this relied on set_query somehow..
         //this.current_query = null;
        this.current_query=manifold.find_query(this.options.query_uuid);
         /* Transforms the table into DataTable, and keep a pointer to it */
        actual_options = {
             // Customize the position of Datatables elements (length,filter,button,...)
-            // http://datatables.net/release-datatables/examples/advanced_init/dom_toolbar.html
-            // http://www.datatables.net/forums/discussion/3914/adding-buttons-to-header-or-footer/p1
-           sDom: "<'row-fluid'<'span4'l><'span7'f><'span1'r>>t<'row-fluid'<'span4'i><'span8'p>>",
+           // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time
+           sDom: "<'row-fluid'<'span5'l><'span1'r><'span6'f>>t<'row-fluid'<'span5'i><'span7'p>>",
             sPaginationType: 'bootstrap',
             // Handle the null values & the error : Datatables warning Requested unknown parameter
             // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2
         this.table = $('#hazelnut-' + options.plugin_uuid).dataTable(actual_options);
 
         /* Setup the SelectAll button in the dataTable header */
+       /* xxx not sure this is still working */
         var oSelectAll = $('#datatableSelectAll-'+ options.plugin_uuid);
         oSelectAll.html("<span class='ui-icon ui-icon-check' style='float:right;display:inline-block;'></span>Select All");
         oSelectAll.button();
 
     /***************************************************************************
      * Private methods
+     * xxx I'm not sure why this should not be methods in the Hazelnut class above
      ***************************************************************************/
 
     /**