From: Alexander Ebert Date: Fri, 2 Sep 2016 10:11:21 +0000 (+0200) Subject: Added dynamic table overflow X-Git-Tag: 3.0.0_Beta_1~335 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=45c2f4e8aabe6db9aab85e39c0cd57b61dc13d4d;p=GitHub%2FWoltLab%2FWCF.git Added dynamic table overflow --- diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeTable.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeTable.class.php new file mode 100644 index 0000000000..d8f49aa08e --- /dev/null +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeTable.class.php @@ -0,0 +1,43 @@ + + * @package WoltLabSuite\Core\System\Html\Output\Node + * @since 3.0 + */ +class HtmlOutputNodeTable extends AbstractHtmlOutputNode { + /** + * @inheritDoc + */ + protected $tagName = 'table'; + + /** + * @inheritDoc + */ + public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProcessor) { + if ($this->outputType === 'text/html' || $this->outputType === 'text/simplified-html') { + /** @var \DOMElement $element */ + foreach ($elements as $element) { + // check if table is not contained within another table + $parent = $element; + while ($parent = $parent->parentNode) { + if ($parent->nodeName === 'table') { + continue; + } + } + + $div = $element->ownerDocument->createElement('div'); + $div->setAttribute('class', 'messageTableOverflow'); + + $element->parentNode->insertBefore($div, $element); + $div->appendChild($element); + } + } + } +} diff --git a/wcfsetup/install/files/style/ui/message.scss b/wcfsetup/install/files/style/ui/message.scss index 1b27e71564..f52b324778 100644 --- a/wcfsetup/install/files/style/ui/message.scss +++ b/wcfsetup/install/files/style/ui/message.scss @@ -620,3 +620,10 @@ } } } + +@include screen-sm-down { + /* allow tables to overflow on small screens */ + .messageTableOverflow { + overflow: auto; + } +}