From defb4b91c4773b5bfbc456142d84812a4ca92867 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 26 Aug 2009 21:53:34 +0000 Subject: [PATCH] hide reply and cancel button with css when JS is disabled. svn path=/plone.app.discussion/trunk/; revision=29403 --- plone/app/discussion/browser/comments.py | 4 ++-- plone/app/discussion/browser/javascripts/comments.js | 4 ++-- plone/app/discussion/browser/stylesheets/discussion.css | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 0a113c1..c6f8145 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -80,7 +80,7 @@ class ReplyButtonAction(button.ButtonAction): def replyButtonActionFactory(request, field): button = ReplyButtonAction(request, field) - button.klass += " context" + button.klass += " context hide" return button class CancelButtonAction(button.ButtonAction): @@ -89,7 +89,7 @@ class CancelButtonAction(button.ButtonAction): def cancelButtonActionFactory(request, field): button = ReplyButtonAction(request, field) - button.klass += " standalone" + button.klass += " standalone hide" return button diff --git a/plone/app/discussion/browser/javascripts/comments.js b/plone/app/discussion/browser/javascripts/comments.js index a3b68da..a7bcd5b 100644 --- a/plone/app/discussion/browser/javascripts/comments.js +++ b/plone/app/discussion/browser/javascripts/comments.js @@ -72,8 +72,8 @@ jq(document).ready(function() { reply_form.find("input[name='form.buttons.comment']").css("display", "none"); /* Show the reply and cancel buttons. */ - reply_form.find("input[name='form.buttons.reply']").css("display", "inline"); - reply_form.find("input[name='form.buttons.cancel']").css("display", "inline"); + reply_form.find("input[name='form.buttons.reply']").removeClass("hide"); + reply_form.find("input[name='form.buttons.cancel']").removeClass("hide"); /* Show the reply layer with a slide down effect */ reply_div.slideDown("slow"); diff --git a/plone/app/discussion/browser/stylesheets/discussion.css b/plone/app/discussion/browser/stylesheets/discussion.css index e98f58f..a20e7b9 100644 --- a/plone/app/discussion/browser/stylesheets/discussion.css +++ b/plone/app/discussion/browser/stylesheets/discussion.css @@ -1,5 +1,8 @@ /* plone.app.discussion stylesheet */ +.hide { + display: none; +} /* Comments Viewlet ---------------------------------------------------------------- */