From 54023cad5138569432f7c18cf67916fdf70ef80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zanghelini?= Date: Thu, 6 Jul 2017 12:29:37 -0300 Subject: [PATCH] better noscript support --- less/header.less | 74 +++++++++++++++++++++++ less/noscript.less | 34 ----------- lib/modules/quickreply.js | 1 + templates/category.tpl | 3 +- templates/header.tpl | 1 - templates/partials/menu.tpl | 22 ++----- templates/partials/topic/reply-button.tpl | 3 +- 7 files changed, 82 insertions(+), 56 deletions(-) diff --git a/less/header.less b/less/header.less index 160e825..2bf0dbf 100644 --- a/less/header.less +++ b/less/header.less @@ -373,3 +373,77 @@ body.skin-default .header { } } } + +label.dropdown-toggle { + cursor: pointer; + margin: 0; +} + +#user-control-list-check:checked + #user-control-list { + display: block; +} + +.navbar-default { + .navbar-nav { + > li > label { + color: @navbar-default-link-color; + + &:hover, + &:focus { + color: @navbar-default-link-hover-color; + background-color: @navbar-default-link-hover-bg; + } + } + > .active > label { + &, + &:hover, + &:focus { + color: @navbar-default-link-active-color; + background-color: @navbar-default-link-active-bg; + } + } + > .disabled > label { + &, + &:hover, + &:focus { + color: @navbar-default-link-disabled-color; + background-color: @navbar-default-link-disabled-bg; + } + } + > .open > label { + &, + &:hover, + &:focus { + background-color: @navbar-default-link-active-bg; + color: @navbar-default-link-active-color; + } + } + } +} + +.dropdown-menu > li > form > button { + text-align: left; + width: 100%; + background: none; + border: none; + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: @line-height-base; + color: @dropdown-link-color; + white-space: nowrap; // prevent links from randomly breaking onto new lines + + &:hover, + &:focus { + text-decoration: none; + color: @dropdown-link-hover-color; + background-color: @dropdown-link-hover-bg; + } +} + +html[data-dir="rtl"] { + .dropdown-menu > li > form > button { + text-align: right; + } +} diff --git a/less/noscript.less b/less/noscript.less index d1f3d2b..ce74098 100644 --- a/less/noscript.less +++ b/less/noscript.less @@ -81,37 +81,3 @@ noscript { } } } -.noscript { - display: none !important; -} -#user-control-list-check:checked + #user-control-list { - display: block; -} -label.dropdown-toggle { - cursor: pointer; -} -.dropdown-menu > li > form > button { - text-align: left; - width: 100%; - background: none; - border: none; - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: @line-height-base; - color: @dropdown-link-color; - white-space: nowrap; // prevent links from randomly breaking onto new lines - - &:hover, - &:focus { - text-decoration: none; - color: @dropdown-link-hover-color; - background-color: @dropdown-link-hover-bg; - } -} -html[data-dir="rtl"] { - .dropdown-menu > li > form > button { - text-align: right; - } -} \ No newline at end of file diff --git a/lib/modules/quickreply.js b/lib/modules/quickreply.js index 9083ded..a79ae83 100644 --- a/lib/modules/quickreply.js +++ b/lib/modules/quickreply.js @@ -26,6 +26,7 @@ define('persona/quickreply', ['components'], function(components) { $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%'); components.get('topic/quickreply/button').on('click', function(e) { + e.preventDefault(); var replyMsg = components.get('topic/quickreply/text').val(); var replyData = { tid: ajaxify.data.tid, diff --git a/templates/category.tpl b/templates/category.tpl index 4b55e9c..8a5928b 100644 --- a/templates/category.tpl +++ b/templates/category.tpl @@ -8,8 +8,7 @@
- [[category:new_topic_button]] - + [[category:new_topic_button]] [[category:guest-login-post]] diff --git a/templates/header.tpl b/templates/header.tpl index fd9f385..555159a 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -5,7 +5,6 @@ {function.buildMetaTag} - {function.buildLinkTag}