From: Thierry Parmentelat Date: Fri, 21 Dec 2012 14:11:29 +0000 (+0100) Subject: nicer toggles X-Git-Tag: myslice-django-0.1-1~104 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=66436ea5f233988ad910e114864b163d2fcbf5e2;p=myslice.git nicer toggles --- 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 }}