author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
Wed, 07 Apr 2010 11:56:30 +0200 | |
branch | stable |
changeset 5171 | 1c2567af37dd |
parent 5112 | 5bf8baecfaf8 |
child 5658 | 7b9553a9db65 |
child 5668 | 7bd6a8a126b8 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* :organization: Logilab |
|
3 |
* :copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
|
4 |
* :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
5 |
*/ |
|
6 |
||
7 |
CubicWeb.require('htmlhelpers.js'); |
|
8 |
CubicWeb.require('ajax.js'); |
|
9 |
||
10 |
//============= filter form functions ========================================// |
|
11 |
function copyParam(origparams, newparams, param) { |
|
12 |
var index = findValue(origparams[0], param); |
|
13 |
if (index > -1) { |
|
14 |
newparams[param] = origparams[1][index]; |
|
15 |
} |
|
16 |
} |
|
17 |
||
18 |
function facetFormContent(form) { |
|
4
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
19 |
var names = []; |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
20 |
var values = []; |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
21 |
jQuery(form).find('.facet').each(function () { |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
22 |
var facetName = jQuery(this).find('.facetTitle').attr('cubicweb:facetName'); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
23 |
var facetValues = jQuery(this).find('.facetValueSelected').each(function(x) { |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
24 |
names.push(facetName); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
25 |
values.push(this.getAttribute('cubicweb:value')); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
26 |
}); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
27 |
}); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
28 |
jQuery(form).find('input').each(function () { |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
29 |
names.push(this.name); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
30 |
values.push(this.value); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
31 |
}); |
1894
c41c539b8f34
[javascript] the @attr (xpath) syntax doesn't work anymore with jquery1.3, forget the @
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1419
diff
changeset
|
32 |
jQuery(form).find('select option[selected]').each(function () { |
0 | 33 |
names.push(this.parentNode.name); |
34 |
values.push(this.value); |
|
35 |
}); |
|
4
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
36 |
return [names, values]; |
0 | 37 |
} |
38 |
||
39 |
function buildRQL(divid, vid, paginate, vidargs) { |
|
40 |
jQuery(CubicWeb).trigger('facets-content-loading', [divid, vid, paginate, vidargs]); |
|
41 |
var form = getNode(divid+'Form'); |
|
42 |
var zipped = facetFormContent(form); |
|
4
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
43 |
zipped[0].push('facetargs'); |
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
44 |
zipped[1].push(vidargs); |
1419 | 45 |
var d = asyncRemoteExec('filter_build_rql', zipped[0], zipped[1]); |
0 | 46 |
d.addCallback(function(result) { |
47 |
var rql = result[0]; |
|
5
64072193bd48
simple and naive implementation of 'bookmark this search' while using facets
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
4
diff
changeset
|
48 |
var $bkLink = jQuery('#facetBkLink'); |
64072193bd48
simple and naive implementation of 'bookmark this search' while using facets
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
4
diff
changeset
|
49 |
if ($bkLink.length) { |
5112
5bf8baecfaf8
[facet] fix 'bookmark this search':
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3129
diff
changeset
|
50 |
var bkPath = 'view?rql=' + escape(rql); |
5
64072193bd48
simple and naive implementation of 'bookmark this search' while using facets
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
4
diff
changeset
|
51 |
if (vid) { |
5112
5bf8baecfaf8
[facet] fix 'bookmark this search':
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3129
diff
changeset
|
52 |
bkPath += '&vid=' + escape(vid); |
5
64072193bd48
simple and naive implementation of 'bookmark this search' while using facets
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
4
diff
changeset
|
53 |
} |
5112
5bf8baecfaf8
[facet] fix 'bookmark this search':
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3129
diff
changeset
|
54 |
var bkUrl = $bkLink.attr('cubicweb:target') + '&path=' + escape(bkPath); |
5
64072193bd48
simple and naive implementation of 'bookmark this search' while using facets
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
4
diff
changeset
|
55 |
$bkLink.attr('href', bkUrl); |
64072193bd48
simple and naive implementation of 'bookmark this search' while using facets
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
4
diff
changeset
|
56 |
} |
0 | 57 |
var toupdate = result[1]; |
58 |
var extraparams = vidargs; |
|
59 |
var displayactions = jQuery('#' + divid).attr('cubicweb:displayactions'); |
|
60 |
if (displayactions) { extraparams['displayactions'] = displayactions; } |
|
61 |
if (paginate) { extraparams['paginate'] = '1'; } |
|
62 |
// copy some parameters |
|
63 |
// XXX cleanup vid/divid mess |
|
64 |
// if vid argument is specified , the one specified in form params will |
|
65 |
// be overriden by replacePageChunk |
|
66 |
copyParam(zipped, extraparams, 'vid'); |
|
67 |
extraparams['divid'] = divid; |
|
68 |
copyParam(zipped, extraparams, 'divid'); |
|
69 |
copyParam(zipped, extraparams, 'subvid'); |
|
3129
fab471bee6c1
[facets] duhh, necessary fromformfilter hidden was missing
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3107
diff
changeset
|
70 |
copyParam(zipped, extraparams, 'fromformfilter'); |
0 | 71 |
// paginate used to know if the filter box is acting, in which case we |
3008
094c597c1d01
[facets] reload breadcrumbs on facets search
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3006
diff
changeset
|
72 |
// want to reload action box to match current selection (we don't want |
094c597c1d01
[facets] reload breadcrumbs on facets search
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3006
diff
changeset
|
73 |
// this from a table filter) |
0 | 74 |
replacePageChunk(divid, rql, vid, extraparams, true, function() { |
75 |
jQuery(CubicWeb).trigger('facets-content-loaded', [divid, rql, vid, extraparams]); |
|
76 |
}); |
|
77 |
if (paginate) { |
|
78 |
// FIXME the edit box might not be displayed in which case we don't |
|
79 |
// know where to put the potential new one, just skip this case |
|
80 |
// for now |
|
81 |
if (jQuery('#edit_box').length) { |
|
82 |
reloadComponent('edit_box', rql, 'boxes', 'edit_box'); |
|
83 |
} |
|
3008
094c597c1d01
[facets] reload breadcrumbs on facets search
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3006
diff
changeset
|
84 |
if (jQuery('#breadcrumbs').length) { |
094c597c1d01
[facets] reload breadcrumbs on facets search
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3006
diff
changeset
|
85 |
reloadComponent('breadcrumbs', rql, 'components', 'breadcrumbs'); |
3011 | 86 |
} |
0 | 87 |
} |
1419 | 88 |
var d = asyncRemoteExec('filter_select_content', toupdate, rql); |
0 | 89 |
d.addCallback(function(updateMap) { |
90 |
for (facetId in updateMap) { |
|
91 |
var values = updateMap[facetId]; |
|
92 |
jqNode(facetId).find('.facetCheckBox').each(function () { |
|
93 |
var value = this.getAttribute('cubicweb:value'); |
|
94 |
if (!values.contains(value)) { |
|
95 |
if (!jQuery(this).hasClass('facetValueDisabled')) { |
|
96 |
jQuery(this).addClass('facetValueDisabled'); |
|
97 |
} |
|
98 |
} else { |
|
99 |
if (jQuery(this).hasClass('facetValueDisabled')) { |
|
100 |
jQuery(this).removeClass('facetValueDisabled'); |
|
101 |
} |
|
102 |
} |
|
103 |
}); |
|
104 |
} |
|
105 |
}); |
|
106 |
}); |
|
107 |
} |
|
108 |
||
109 |
||
110 |
var SELECTED_IMG = baseuri()+"data/black-check.png"; |
|
111 |
var UNSELECTED_IMG = baseuri()+"data/no-check-no-border.png"; |
|
2012
64c82e15fa98
[facets] add new unchecked's checkbox image
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1894
diff
changeset
|
112 |
var UNSELECTED_BORDER_IMG = baseuri()+"data/black-uncheck.png"; |
0 | 113 |
|
933
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
114 |
function initFacetBoxEvents(root) { |
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
115 |
// facetargs : (divid, vid, paginate, extraargs) |
0 | 116 |
root = root || document; |
117 |
jQuery(root).find('form').each(function () { |
|
118 |
var form = jQuery(this); |
|
933
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
119 |
// NOTE: don't evaluate facetargs here but in callbacks since its value |
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
120 |
// may changes and we must send its value when the callback is |
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
121 |
// called, not when the page is initialized |
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
122 |
var facetargs = form.attr('cubicweb:facetargs'); |
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
123 |
if (facetargs !== undefined) { |
0 | 124 |
form.submit(function() { |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
125 |
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); |
0 | 126 |
return false; |
127 |
}); |
|
128 |
form.find('div.facet').each(function() { |
|
129 |
var facet = jQuery(this); |
|
130 |
facet.find('div.facetCheckBox').each(function (i) { |
|
131 |
this.setAttribute('cubicweb:idx', i); |
|
132 |
}); |
|
133 |
facet.find('div.facetCheckBox').click(function () { |
|
134 |
var $this = jQuery(this); |
|
3107
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
135 |
// NOTE : add test on the facet operator (i.e. OR, AND) |
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
136 |
// if ($this.hasClass('facetValueDisabled')){ |
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
137 |
// return |
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
138 |
// } |
0 | 139 |
if ($this.hasClass('facetValueSelected')) { |
140 |
$this.removeClass('facetValueSelected'); |
|
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
141 |
$this.find('img').each(function (i){ |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
142 |
if (this.getAttribute('cubicweb:unselimg')){ |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
143 |
this.setAttribute('src', UNSELECTED_BORDER_IMG); |
2324
810fcd045f7c
# set right alt values, fix disapearing values in facetCheckBox
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2013
diff
changeset
|
144 |
this.setAttribute('alt', (_('not selected'))); |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
145 |
} |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
146 |
else{ |
2012
64c82e15fa98
[facets] add new unchecked's checkbox image
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1894
diff
changeset
|
147 |
this.setAttribute('src', UNSELECTED_IMG); |
2325
363b66a15668
[cleaning] minor cleaning over last two checkins
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2324
diff
changeset
|
148 |
this.setAttribute('alt', (_('not selected'))); |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
149 |
} |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
150 |
}); |
0 | 151 |
var index = parseInt($this.attr('cubicweb:idx')); |
2342
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
152 |
// we dont need to move the element when cubicweb:idx == 0 |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
153 |
if (index > 0){ |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
154 |
var shift = jQuery.grep(facet.find('.facetValueSelected'), function (n) { |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
155 |
var nindex = parseInt(n.getAttribute('cubicweb:idx')); |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
156 |
return nindex > index; |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
157 |
}).length; |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
158 |
index += shift; |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
159 |
var parent = this.parentNode; |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
160 |
var $insertAfter = jQuery(parent).find('.facetCheckBox:nth('+index+')'); |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
161 |
if ( ! ($insertAfter.length == 1 && shift == 0) ) { |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
162 |
// only rearrange element if necessary |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
163 |
$insertAfter.after(this); |
923111e6ab33
do nothing if the clicked facet has facetValueDisabled class; do not move facet when cubicweb:idx == 0
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
2325
diff
changeset
|
164 |
} |
2325
363b66a15668
[cleaning] minor cleaning over last two checkins
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2324
diff
changeset
|
165 |
} |
0 | 166 |
} else { |
167 |
var lastSelected = facet.find('.facetValueSelected:last'); |
|
168 |
if (lastSelected.length) { |
|
169 |
lastSelected.after(this); |
|
170 |
} else { |
|
171 |
var parent = this.parentNode; |
|
172 |
jQuery(parent).prepend(this); |
|
173 |
} |
|
174 |
jQuery(this).addClass('facetValueSelected'); |
|
2325
363b66a15668
[cleaning] minor cleaning over last two checkins
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2324
diff
changeset
|
175 |
var $img = jQuery(this).find('img'); |
363b66a15668
[cleaning] minor cleaning over last two checkins
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2324
diff
changeset
|
176 |
$img.attr('src', SELECTED_IMG).attr('alt', (_('selected'))); |
0 | 177 |
} |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
178 |
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); |
0 | 179 |
facet.find('.facetBody').animate({scrollTop: 0}, ''); |
180 |
}); |
|
181 |
facet.find('select.facetOperator').change(function() { |
|
182 |
var nbselected = facet.find('div.facetValueSelected').length; |
|
183 |
if (nbselected >= 2) { |
|
933
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
184 |
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); |
0 | 185 |
} |
186 |
}); |
|
187 |
facet.find('div.facetTitle').click(function() { |
|
188 |
facet.find('div.facetBody').toggleClass('hidden').toggleClass('opened'); |
|
189 |
jQuery(this).toggleClass('opened'); |
|
190 |
}); |
|
191 |
||
192 |
}); |
|
193 |
} |
|
194 |
}); |
|
195 |
} |
|
196 |
||
197 |
// trigger this function on document ready event if you provide some kind of |
|
198 |
// persistent search (eg crih) |
|
199 |
function reorderFacetsItems(root){ |
|
200 |
root = root || document; |
|
201 |
jQuery(root).find('form').each(function () { |
|
202 |
var form = jQuery(this); |
|
933
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
203 |
if (form.attr('cubicweb:facetargs')) { |
0 | 204 |
form.find('div.facet').each(function() { |
4
8a607bdc11dc
[javascript] indentation fixes + missing semi colons
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
205 |
var facet = jQuery(this); |
0 | 206 |
var lastSelected = null; |
207 |
facet.find('div.facetCheckBox').each(function (i) { |
|
208 |
var $this = jQuery(this); |
|
209 |
if ($this.hasClass('facetValueSelected')) { |
|
210 |
if (lastSelected) { |
|
211 |
lastSelected.after(this); |
|
212 |
} else { |
|
213 |
var parent = this.parentNode; |
|
214 |
jQuery(parent).prepend(this); |
|
215 |
} |
|
216 |
lastSelected = $this; |
|
217 |
} |
|
218 |
}); |
|
219 |
}); |
|
220 |
} |
|
221 |
}); |
|
222 |
} |
|
223 |
||
224 |
// we need to differenciate cases where initFacetBoxEvents is called |
|
225 |
// with one argument or without any argument. If we use `initFacetBoxEvents` |
|
226 |
// as the direct callback on the jQuery.ready event, jQuery will pass some argument |
|
227 |
// of his, so we use this small anonymous function instead. |
|
228 |
jQuery(document).ready(function() {initFacetBoxEvents();}); |
|
229 |
||
3006
4d85386b06a5
rename cubicweb.formfilter.js into cubicweb.facets.js
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2342
diff
changeset
|
230 |
CubicWeb.provide('facets.js'); |