Commit d46e96c0 authored by Denis Chenu's avatar Denis Chenu
Browse files

[feature] Fix width for renderer when loading

parent 03893040
......@@ -4,6 +4,7 @@
* @copyright Denis Chenu <http://www.sondages.pro>
* @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0
*/
/* global wrapper table */
.pvtUi{table-layout:fixed;width:100%}
.pvtUi tr td:first-child,.pvtVertList{width:15em}
.pvtVals,.pvtRows{width:15em}
......@@ -11,10 +12,15 @@
list-style: none;
}
.pvtUi .ui-sortable-handle{width:100%;overflow:hidden;position:relative;}
.pvtUi .pvtHorizList .ui-sortable-handle{width:16em;}
.pvtUi .pvtHorizList .ui-sortable-handle{width:16em;display:inline-block}
.pvtUi .ui-sortable-handle{padding-left:2em;text-align:left}
.pvtUi .ui-sortable-handle .pvtTriangle{position:absolute;left:0.5em;top:0.5em}
.pvtUi .pvtVertList{min-height:25em}
.pvtUi .pvtVertList{height:25em;padding-bottom:2em}/* in td : min-height is height */
.pvtUi .pvtRendererArea{font-size:85%}
/* cloned wrapper table */
#pivot-table-clone .table-bordered > tbody > tr > td {padding-bottom:0;padding-top:0;border-width:0 1px;}
#pivot-table-clone .table-bordered {border-width:0 1px;}
/* filter part */
.pvtFilteredAttribute { font-style: italic }
.pvtFilterBox{
......@@ -25,7 +31,7 @@
.pvtFilterBox h4{margin:0}
.pvtFilterBox .pvtCheckContainer p { margin: 0.2em; }
.pvtFilterBox label { font-weight: normal; }
.pvtFilterBox .count { font-style:italic;}
.pvtFilterBox .count { font-style:italic;font-size: 85%;}
.pvtCheckContainer{
white-space: nowrap;
......@@ -38,6 +44,8 @@
table.pvtTable {
text-align: left;
border-collapse: collapse;
width:100%;
table-layout:fixed;
}
table.pvtTable thead tr th, table.pvtTable tbody tr th {
background-color: #e6EEEE;
......
......@@ -16,16 +16,24 @@ $.fn.firstWord = function() {
};
$(function(){
var derivers = $.pivotUtilities.derivers;
var renderers = $.extend(
var $maxRenderWidth=$("#pivot-table-clone .pvtAxisContainer").innerWidth();
var $derivers = $.pivotUtilities.derivers;
var $renderers = $.extend(
$.pivotUtilities.renderers,
$.pivotUtilities.c3_renderers,
$.pivotUtilities.d3_renderers,
$.pivotUtilities.export_renderers
);
$.getJSON(LS.plugin.statsPivotTable.jsonUrl, function(responses) {
$("#pivot-table").pivotUI(responses, {
renderers : renderers,
$.getJSON(LS.plugin.statsPivotTable.jsonUrl, function($responses) {
$("#pivot-table").pivotUI($responses, {
renderers : $renderers,
rendererOptions: {
c3: {
size : {
width:$maxRenderWidth-10,
}
},
},
onRefresh: function() {
$("#pivot-table-construct").fadeOut(400).remove();
$("#pivot-table .pvtUi").addClass('table table-condensed table-bordered');
......@@ -41,7 +49,7 @@ $(function(){
$("#pivot-table .pvtFilterBox h4").addClass("panel-heading");
$("#pivot-table .pvtFilterBox .pvtCheckContainer").addClass("panel-body");
$("#pivot-table .pvtFilterBox > p").addClass("panel-footer");
$("#pivot-table .pvtFilterBox .count").addClass("badge");
$("#pivot-table .pvtFilterBox .count").addClass("badge small");
/* Commented : this brokepivotable.js
$("#pivot-table").find(".ui-sortable-handle").each(function(){
$(this).firstWord();
......
......@@ -2,6 +2,8 @@
<div class="col-lg-12 content-right">
<h3><?php echo $gT['title'];?></h3>
<div id="pivot-table-construct" class="text-center"><i class="fa fa-refresh fa-spin fa-5x" aria-hidden="true"></i><span class="sr-only"><?php echo gT("loading") ?></span></div>
<div id="pivot-table-clone"><table class="pvtUi table table-condensed table-bordered"><tbody><tr><td></td><td class="pvtVals"></td><td class="pvtAxisContainer pvtHorizList pvtCols ui-sortable active"></td></tr></tbody></table></div>
<div id="pivot-table"></div>
</div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment