cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] branch debian9-systemvmtemplate updated: fix thead and tbody in separate table, causes tables to appear weird
Date Thu, 30 Nov 2017 12:44:02 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/debian9-systemvmtemplate by this push:
     new 267db62  fix thead and tbody in separate table, causes tables to appear weird
267db62 is described below

commit 267db62d4bd83db3bb367b46c994aae0e9fc7719
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Thu Nov 30 18:12:37 2017 +0530

    fix thead and tbody in separate table, causes tables to appear weird
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 ui/css/cloudstack3.css             |  2 +-
 ui/scripts/ui/widgets/dataTable.js | 26 +++-----------------------
 ui/scripts/ui/widgets/listView.js  | 11 +++++++----
 3 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 987f35d..12964af 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -96,7 +96,7 @@ a:hover {
 
 /*Table*/
 table {
-  width: 940px;
+  width: 100%;
   max-width: 977px;
   margin: 15px 15px 12px 12px;
   font-size: 13px;
diff --git a/ui/scripts/ui/widgets/dataTable.js b/ui/scripts/ui/widgets/dataTable.js
index 4574052..775d751 100644
--- a/ui/scripts/ui/widgets/dataTable.js
+++ b/ui/scripts/ui/widgets/dataTable.js
@@ -78,21 +78,6 @@
             return true;
         };
 
-        var splitTable = function() {
-            var $mainContainer = $('<div>')
-                .addClass('data-table')
-                .appendTo($table.parent())
-                .append(
-                    $table.detach()
-            );
-            $table = $mainContainer;
-            var $theadContainer = $('<div>').addClass('fixed-header').prependTo($table);
-            var $theadTable = $('<table>').appendTo($theadContainer).attr('nowrap',
'nowrap');
-            var $thead = $table.find('thead').detach().appendTo($theadTable);
-
-            return $thead;
-        };
-
         /**
          * Event to set resizable appearance on hover
          */
@@ -226,14 +211,12 @@
         };
 
         var resizeHeaders = function() {
-            var $thead = $table.hasClass('no-split') ? $table.find('thead') : $table.closest('div.data-table').find('thead');
+            var $thead = $table.closest('div.data-table').find('thead');
             var $tbody = $table.find('tbody');
             var $ths = $thead.find('th');
             var $tds = $tbody.find('tr:first td');
 
-            if ($table.hasClass('no-split')) {
-                $tbody.width($thead.width());
-            }
+            $tbody.width($thead.width());
 
             if ($ths.size() > $tds.size()) {
                 $ths.width(
@@ -288,10 +271,7 @@
 
         var init = function() {
             var noSelect = options && options.noSelect == true ? true : false;
-            if (!$table.closest('div.data-table').size() && !$table.hasClass('no-split'))
{
-                splitTable();
-                $table.find('tbody').closest('table').addClass('body');
-            }
+            $table.find('tbody').closest('table').addClass('body');
 
             if (!$table.hasClass('horizontal-overflow')) {
                 $table.find('th:not(:has(input))').bind('mousemove mouseout', hoverResizableEvent);
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index fed6194..d9325ec 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -766,7 +766,7 @@
         if (!options) options = {};
 
         var $tr = $('<tr>');
-        var $thead = $('<thead>').prependTo($table).append($tr);
+        var $thead = $('<thead>').append($tr);
         var reorder = options.reorder;
         var detailView = options.detailView;
         var multiSelect = options.multiSelect;
@@ -1959,9 +1959,7 @@
             });
         }
 
-        $('<tbody>').appendTo($table);
-
-        createHeader(listViewData.preFilter,
+        var $thead = createHeader(listViewData.preFilter,
             listViewData.fields,
             $table,
             listViewData.actions, {
@@ -1987,6 +1985,9 @@
         createSearchBar($toolbar, listViewData);
         }
 
+        var $tbody = $('<tbody>');
+        $tbody.appendTo($table);
+
         loadBody(
             $table,
             listViewData.dataProvider,
@@ -2012,6 +2013,8 @@
             }
         );
 
+        $thead.prependTo($table);
+
         // Keyboard events
         $listView.bind('keypress', function(event) {
             var code = (event.keyCode ? event.keyCode : event.which);

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].

Mime
View raw message