From: Nicolas Boisselier Date: Thu, 7 Jan 2016 01:01:01 +0000 (+0000) Subject: max with for rows X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a00df7dc02d2a4b25b7c3f5c098dfbd5e59a534e;p=nb.git max with for rows --- diff --git a/lib/js/nb.js b/lib/js/nb.js index 6ec45081..4ca52f5d 100644 --- a/lib/js/nb.js +++ b/lib/js/nb.js @@ -18,6 +18,19 @@ function NB() { // Used in css to trigger a resize $('body').append(''); + + // Max width for blocks + var block = $("table, div"); + if (block) { + var width = $(window).width(); + if (block.width() > width) { + block.css({ + 'display': 'block', + 'overflow': 'scroll', + }).width(width - 10); + } + } + } this.table2div = function(find) {