From 365d07ff6c481e604cd83425abe128eff3af70f0 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sat, 26 Oct 2013 09:51:07 +0300 Subject: [PATCH] [ticket/11957] Responsive forms PHPBB3-11957 --- phpBB/adm/style/admin.css | 60 +++++++++++++++++++++++++++++++++++++++ phpBB/adm/style/admin.js | 11 +++++++ 2 files changed, 71 insertions(+) diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index f644adb0d4..a98bcffe3b 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1053,6 +1053,13 @@ select#full_folder_action { width: 95%; } +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + fieldset { + padding: 5px; + } +} + /* Definition list layout for forms Other general def. list properties defined in prosilver_main.css ---------------------------------------- */ @@ -1184,6 +1191,51 @@ input:focus, textarea:focus { outline-style: none; } +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + fieldset dl { + margin-bottom: 5px; + padding-bottom: 5px; + border-bottom: 1px solid #e8e8e8; + } + + fieldset > dl:last-child, fieldset > form:last-child > dl:last-child { + border-bottom-width: 0; + margin-bottom: 0; + } + + fieldset dt, .rtl fieldset dt, fieldset dd, .rtl fieldset dd { + border-width: 0; + margin-left: 0; + margin-right: 0; + float: none; + width: auto; + } + + .ltr fieldset dd { + padding-left: 20px; + } + + .rtl fieldset dd { + padding-right: 20px; + } + + dd select, dd input { + max-width: 300px; + } + + dd input[type="number"] { + max-width: 70px; + } +} + +@media only screen and (max-width: 400px), only screen and (max-device-width: 400px) +{ + dd select, dd input { + max-width: 240px; + } +} + /* Submit button fieldset or paragraph ---------------------------------------- */ fieldset.submit-buttons { @@ -1926,3 +1978,11 @@ fieldset.permissions .padding { color: #FFFFFF; font-size: 1.4em; } + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + .responsive-hide { display: none !important; } + .responsive-show { display: block !important; } + .responsive-show-inline { display: inline !important; } + .responsive-show-inline-block { display: inline-block !important; } +} diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js index 385e49dc87..342859ce54 100644 --- a/phpBB/adm/style/admin.js +++ b/phpBB/adm/style/admin.js @@ -133,6 +133,17 @@ function parse_document(container) $(this).parent('table:first').addClass('responsive-hide'); } }); + + /** + * Fieldsets with empty + */ + container.find('fieldset dt > span:last-child').each(function() { + var $this = $(this); + if ($this.html() == ' ') { + $this.addClass('responsive-hide'); + } + + }); } /**