}
this.resize = function() {
+
+ // table to div
+ if ($('#_responsive').css('content') != 'none') {
+ that.table2div('table.rows');
+ return true;
+ } else {
+ $('table.rows').addClass('t2d');
+ $('.t2d-th').each(function(){
+ $(this).remove();
+ });
+ }
+
// Max width for blocks
var block = $("table, div");
- if (block) {
- var width = $(window).width();
- var set_width = width - 20;
- block.each(function(){
-
- var first_width = $(this).attr('nb.resize');
- var cur_width = $(this).width();
- if (cur_width > width) {
- if (!first_width) {
- $(this).attr('nb.resize',cur_width);
- }
- if (this.tagName == 'TABLE') $(this).css({
- 'display': 'block',
- 'overflow': 'scroll',
- });
- $(this).width(set_width);
- //console.log(this.tagName+' : '+$(this).width()+' / '+width);
+ if (!block) return false;
- } else {
+ var width = $(window).width();
+ var set_width = width - 20;
+ block.each(function(){
- if (first_width) {
+ var first_width = $(this).attr('nb-resize');
+ var cur_width = $(this).width();
- if (this.tagName == 'TABLE') {
- $(this).css({
- 'display': 'table',
- 'overflow': 'visible',
- });
+ if (cur_width > width) {
+ if (!first_width) {
+ $(this).attr('nb-resize',cur_width);
+ }
+ if (this.tagName == 'TABLE') $(this).css({
+ 'display': 'block',
+ 'overflow': 'scroll',
+ });
+ $(this).width(set_width);
+ //console.log(this.tagName+' : '+$(this).width()+' / '+width);
- } else {
- $(this).width((set_width < first_width) ? set_width : first_width);
+ } else {
- }
- //console.log(this.tagName+' : '+$(this).attr('nb.resize'));
+ if (first_width) {
+
+ if (this.tagName == 'TABLE') {
+ $(this).css({
+ 'display': 'table',
+ 'overflow': 'visible',
+ });
+
+ } else {
+ $(this).width((set_width < first_width) ? set_width : first_width);
}
+ //console.log(this.tagName+' : '+$(this).attr('nb-resize'));
}
- });
- }
+ }
+
+ });
}