summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-12-04 19:26:42 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-12-04 19:26:42 (GMT)
commite28a3076ae9e9863021d839b6a996fdb6b188e59 (patch)
tree29765dc73f118c0577afaedef90f3bb934c7ea03
parenta082e7948f4e6eabf7fff4591fff0285f175f6b7 (diff)
downloadtabellio.searchform-e28a3076ae9e9863021d839b6a996fdb6b188e59.zip
tabellio.searchform-e28a3076ae9e9863021d839b6a996fdb6b188e59.tar.gz
tabellio.searchform-e28a3076ae9e9863021d839b6a996fdb6b188e59.tar.bz2
fix help for question types
-rw-r--r--tabellio/searchform/docsearchpfb.pt40
1 files changed, 3 insertions, 37 deletions
diff --git a/tabellio/searchform/docsearchpfb.pt b/tabellio/searchform/docsearchpfb.pt
index d929a2b..2d29ad6 100644
--- a/tabellio/searchform/docsearchpfb.pt
+++ b/tabellio/searchform/docsearchpfb.pt
@@ -225,7 +225,7 @@ identification et son classement</dd>
</dl>
</div>
-<div id="help-for-questype">
+<div id="help-for-l_questypes">
<dl>
<dt>Type</dt>
<dd><p>définit la catégorie à laquelle appartient un document parlementaire</p>
@@ -253,36 +253,9 @@ celle-ci</li>
<script type="text/javascript" tal:content="string: var PORTAL_URL='${view/portal_url}';"></script>
<script metal:use-macro="view/js_macros/macros/labelboxes"></script>
+<script metal:use-macro="view/js_macros/macros/droppablecheckboxes"></script>
+<script metal:use-macro="view/js_macros/macros/sorton"></script>
<script type="text/javascript">
-function sync_from_checkboxes(elem, dummyinput)
-{
- t = '';
- $(elem).find('span.option').each(function(idx, el) {
- if ($(el).find('input').attr('checked')) {
- if (t.length > 0) {
- t = t + ', ';
- }
- t = t + $(el).find('label span').text();
- }
- });
- $(dummyinput).attr('value', t);
-}
-
-
-function setup_appearance(index, elem)
-{
- var dummyinput = $('<input class="dummyinput" type="text" readonly="readonly"/>');
- sync_from_checkboxes(elem, dummyinput);
- dummyinput.click(function() {
- $(elem).find('div.droppedcheckboxes').toggle().parent().toggleClass('openboxes');
- });
- $(elem).find('.fieldErrorBox').after(dummyinput);
- $(elem).find('span.option').wrapAll('<div class="droppedcheckboxes">').click(function() {
- sync_from_checkboxes(elem, dummyinput);
- });
- $(elem).find('div.droppedcheckboxes').hide();
-}
-
function setup_default_session(index, elem)
{
if ($(elem).find('option[selected]').length == 0) {
@@ -312,9 +285,6 @@ function setup_help_icon(index, elem)
(function($) {
$().ready(function() {
- $('#formfield-document-widgets-l_doctypes').each(setup_appearance);
- $('#formfield-document-widgets-l_topics').each(setup_appearance);
- $('#formfield-document-widgets-l_polgroups').each(setup_appearance);
$('#document-widgets-session').each(setup_default_session);
$('#question-widgets-session').each(setup_default_session);
$('#adopteddocument-widgets-session').each(setup_default_session);
@@ -328,13 +298,9 @@ function setup_help_icon(index, elem)
var parent = $(this).parent();
$(this).detach().appendTo(parent);
});
- $('#formfield-adopteddocument-widgets-l_doctypes').each(setup_appearance);
- $('#formfield-adopteddocument-widgets-l_topics').each(setup_appearance);
- $('#formfield-adopteddocument-widgets-l_polgroups').each(setup_appearance);
});
})(jQuery);
</script>
-<script metal:use-macro="view/js_macros/macros/sorton"></script>
</tal:block>
</tal:main-macro>