Revision 3026:d924f063cef6,
892 bytes
checked in by franck <carnet.franck.paul@…>, 10 years ago
(diff) |
Cope with dotclear.filter_reset_url if set with an dcPage::jsVar('dotclear.filter_reset_url', 'plugin.php?p=myPlugin'), Fixes #1944.
|
Line | |
---|
1 | $(function() { |
---|
2 | var reset_url = '?'; |
---|
3 | if (dotclear.filter_reset_url != undefined) { |
---|
4 | reset_url = dotclear.filter_reset_url; |
---|
5 | } |
---|
6 | |
---|
7 | $filtersform = $('#filters-form'); |
---|
8 | $filtersform.before('<p><a id="filter-control" class="form-control" href="'+reset_url+'" style="display:inline">'+dotclear.msg.filter_posts_list+'</a></p>') |
---|
9 | |
---|
10 | if( dotclear.msg.show_filters == 'false' ) { |
---|
11 | $filtersform.hide(); |
---|
12 | } else { |
---|
13 | $('#filter-control') |
---|
14 | .addClass('open') |
---|
15 | .text(dotclear.msg.cancel_the_filter); |
---|
16 | } |
---|
17 | |
---|
18 | $('#filter-control').click(function() { |
---|
19 | if( $(this).hasClass('open') ) { |
---|
20 | if( dotclear.msg.show_filters == 'true' ) { |
---|
21 | return true; |
---|
22 | } else { |
---|
23 | $filtersform.hide(); |
---|
24 | $(this).removeClass('open') |
---|
25 | .text(dotclear.msg.filter_posts_list); |
---|
26 | } |
---|
27 | } else { |
---|
28 | $filtersform.show(); |
---|
29 | $(this).addClass('open') |
---|
30 | .text(dotclear.msg.cancel_the_filter); |
---|
31 | } |
---|
32 | return false; |
---|
33 | }); |
---|
34 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.