From 66436ea5f233988ad910e114864b163d2fcbf5e2 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 21 Dec 2012 15:11:29 +0100 Subject: [PATCH] nicer toggles --- engine/static/js/plugin.js | 5 +++++ engine/templates/plugin.html | 10 +++++----- plugins/templates/verticallayout.html | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/engine/static/js/plugin.js b/engine/static/js/plugin.js index c5a9de80..7c22af6b 100644 --- a/engine/static/js/plugin.js +++ b/engine/static/js/plugin.js @@ -2,14 +2,19 @@ * and configure their behaviour */ $(document).ready(function() { + window.console.log("Setting plugin toggle behaviour"); $('.plugin-hide').each(function() { + window.console.log("Setting plugin toggle behaviour on hide "+$(this).attr('id')); $(this).click(function () { + window.console.log("click on a HIDE button"); var plugin='#'+$(this).attr('id').replace('hide-',''); var show='#'+$(this).attr('id').replace('hide-','show-'); jQuery(plugin).hide(); jQuery(show).show(); $(this).hide();}); }) $('.plugin-show').each(function() { + window.console.log("Setting plugin toggle behaviour on show "+$(this).attr('id')); $(this).click(function () { + window.console.log("click on a SHOW button"); var plugin='#'+$(this).attr('id').replace('show-',''); var hide='#'+$(this).attr('id').replace('show-','hide-'); jQuery(plugin).show(); jQuery(hide).show(); $(this).hide();}); diff --git a/engine/templates/plugin.html b/engine/templates/plugin.html index 8f9518d0..d4b5cf1d 100644 --- a/engine/templates/plugin.html +++ b/engine/templates/plugin.html @@ -3,16 +3,16 @@
{% if togglable %} {% if not toggled %} -

» Show {{ classname }} "{{ title }}"

- +

Show {{ title }} ({{ classname }})

+ {% else %} - -

« Hide {{ classname }} "{{ title }}"

+ +

Hide {{ title }} ({{ classname }})

{% endif %}{# toggled #} {% endif %}{# togglable #} {% endif %}{# visible #} -
+ diff --git a/plugins/templates/verticallayout.html b/plugins/templates/verticallayout.html index 53ce5907..f765cd17 100644 --- a/plugins/templates/verticallayout.html +++ b/plugins/templates/verticallayout.html @@ -1,6 +1,6 @@
{% for son in sons %} -

{{ son.title }}

+{#

{{ son.title }}

#}
{{ son.rendered }}
-- 2.43.0