diff --git a/js/bluecheese.js b/js/bluecheese.js index 628258df0f67fd5fb28088e092922e4c0a49a508..7d4650dfc539636e2c179205a8170f32fd1ca6dc 100644 --- a/js/bluecheese.js +++ b/js/bluecheese.js @@ -2,19 +2,22 @@ $(document).ready(function() { var windowsize = $(window).width(); - $('table').not('#forum table').not('.page-user-track table').not('#project-usage-project-releases').each(function() { - // If the table is wider than the width of the window. - if ($(this).width() > windowsize) { - $(this).addClass('mobile-table'); - } - }); - - // Use mobile tables for narrow tables. - $('.drupalorg-site-api table.views-table').each(function() { - var $this = $(this); - if ($this.width() < 500 && $this.width() === $this.parent().width()) { - $this.addClass('mobile-table'); - } - }); + if ($('body.drupalorg-site-api').length) { + // Use mobile tables for narrow views tables. + $('table.views-table').each(function() { + var $this = $(this); + if ($this.width() < 500 && $this.width() === $this.parent().width()) { + $this.addClass('mobile-table'); + } + }); + } + else { + $('table').not('#forum table').not('.page-user-track table').not('#project-usage-project-releases').each(function() { + // If the table is wider than the width of the window. + if ($(this).width() > windowsize) { + $(this).addClass('mobile-table'); + } + }); + } }); })(jQuery); diff --git a/sass/partials/common/_api.scss b/sass/partials/common/_api.scss index 5694fbb75def9dc5a74a679e4d80e6d972a0a3ee..d6008df3f2dcbcd29f2b203fb776eb3ff46609ef 100644 --- a/sass/partials/common/_api.scss +++ b/sass/partials/common/_api.scss @@ -6,7 +6,7 @@ margin-bottom: 5px; } - table { + table.views-table { @include force-wrap; .views-field-object-type, .views-field-modifiers { @include word-break(normal);