author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Fri, 04 Jun 2010 13:07:57 +0200 | |
branch | stable |
changeset 5668 | 7bd6a8a126b8 |
parent 5112 | 5bf8baecfaf8 |
child 5679 | 0f2ded880d01 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* :organization: Logilab |
|
5668
7bd6a8a126b8
no more need for specific handling of table view's displayaction
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5112
diff
changeset
|
3 |
* :copyright: 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
0 | 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; |
|
5668
7bd6a8a126b8
no more need for specific handling of table view's displayaction
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5112
diff
changeset
|
59 |
if (paginate) { extraparams['paginate'] = '1'; } // XXX in vidargs |
0 | 60 |
// copy some parameters |
61 |
// XXX cleanup vid/divid mess |
|
62 |
// if vid argument is specified , the one specified in form params will |
|
63 |
// be overriden by replacePageChunk |
|
64 |
copyParam(zipped, extraparams, 'vid'); |
|
65 |
extraparams['divid'] = divid; |
|
66 |
copyParam(zipped, extraparams, 'divid'); |
|
67 |
copyParam(zipped, extraparams, 'subvid'); |
|
3129
fab471bee6c1
[facets] duhh, necessary fromformfilter hidden was missing
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3107
diff
changeset
|
68 |
copyParam(zipped, extraparams, 'fromformfilter'); |
0 | 69 |
// 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
|
70 |
// 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
|
71 |
// this from a table filter) |
0 | 72 |
replacePageChunk(divid, rql, vid, extraparams, true, function() { |
73 |
jQuery(CubicWeb).trigger('facets-content-loaded', [divid, rql, vid, extraparams]); |
|
74 |
}); |
|
75 |
if (paginate) { |
|
76 |
// FIXME the edit box might not be displayed in which case we don't |
|
77 |
// know where to put the potential new one, just skip this case |
|
78 |
// for now |
|
79 |
if (jQuery('#edit_box').length) { |
|
80 |
reloadComponent('edit_box', rql, 'boxes', 'edit_box'); |
|
81 |
} |
|
3008
094c597c1d01
[facets] reload breadcrumbs on facets search
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3006
diff
changeset
|
82 |
if (jQuery('#breadcrumbs').length) { |
094c597c1d01
[facets] reload breadcrumbs on facets search
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3006
diff
changeset
|
83 |
reloadComponent('breadcrumbs', rql, 'components', 'breadcrumbs'); |
3011 | 84 |
} |
0 | 85 |
} |
1419 | 86 |
var d = asyncRemoteExec('filter_select_content', toupdate, rql); |
0 | 87 |
d.addCallback(function(updateMap) { |
88 |
for (facetId in updateMap) { |
|
89 |
var values = updateMap[facetId]; |
|
90 |
jqNode(facetId).find('.facetCheckBox').each(function () { |
|
91 |
var value = this.getAttribute('cubicweb:value'); |
|
92 |
if (!values.contains(value)) { |
|
93 |
if (!jQuery(this).hasClass('facetValueDisabled')) { |
|
94 |
jQuery(this).addClass('facetValueDisabled'); |
|
95 |
} |
|
96 |
} else { |
|
97 |
if (jQuery(this).hasClass('facetValueDisabled')) { |
|
98 |
jQuery(this).removeClass('facetValueDisabled'); |
|
99 |
} |
|
100 |
} |
|
101 |
}); |
|
102 |
} |
|
103 |
}); |
|
104 |
}); |
|
105 |
} |
|
106 |
||
107 |
||
108 |
var SELECTED_IMG = baseuri()+"data/black-check.png"; |
|
109 |
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
|
110 |
var UNSELECTED_BORDER_IMG = baseuri()+"data/black-uncheck.png"; |
0 | 111 |
|
933
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
112 |
function initFacetBoxEvents(root) { |
ad99da207edd
late evaluation of cubicweb:facetargs is necessary since its value may change
sylvain.thenault@logilab.fr
parents:
434
diff
changeset
|
113 |
// facetargs : (divid, vid, paginate, extraargs) |
0 | 114 |
root = root || document; |
115 |
jQuery(root).find('form').each(function () { |
|
116 |
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
|
117 |
// 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
|
118 |
// 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
|
119 |
// 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
|
120 |
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
|
121 |
if (facetargs !== undefined) { |
0 | 122 |
form.submit(function() { |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
123 |
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); |
0 | 124 |
return false; |
125 |
}); |
|
126 |
form.find('div.facet').each(function() { |
|
127 |
var facet = jQuery(this); |
|
128 |
facet.find('div.facetCheckBox').each(function (i) { |
|
129 |
this.setAttribute('cubicweb:idx', i); |
|
130 |
}); |
|
131 |
facet.find('div.facetCheckBox').click(function () { |
|
132 |
var $this = jQuery(this); |
|
3107
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
133 |
// 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
|
134 |
// if ($this.hasClass('facetValueDisabled')){ |
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
135 |
// return |
0829808e93c1
fix OR in facets
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
3011
diff
changeset
|
136 |
// } |
0 | 137 |
if ($this.hasClass('facetValueSelected')) { |
138 |
$this.removeClass('facetValueSelected'); |
|
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
139 |
$this.find('img').each(function (i){ |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
140 |
if (this.getAttribute('cubicweb:unselimg')){ |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
141 |
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
|
142 |
this.setAttribute('alt', (_('not selected'))); |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
143 |
} |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
144 |
else{ |
2012
64c82e15fa98
[facets] add new unchecked's checkbox image
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1894
diff
changeset
|
145 |
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
|
146 |
this.setAttribute('alt', (_('not selected'))); |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
147 |
} |
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
148 |
}); |
0 | 149 |
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
|
150 |
// 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
|
151 |
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
|
152 |
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
|
153 |
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
|
154 |
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
|
155 |
}).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
|
156 |
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
|
157 |
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
|
158 |
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
|
159 |
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
|
160 |
// 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
|
161 |
$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
|
162 |
} |
2325
363b66a15668
[cleaning] minor cleaning over last two checkins
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2324
diff
changeset
|
163 |
} |
0 | 164 |
} else { |
165 |
var lastSelected = facet.find('.facetValueSelected:last'); |
|
166 |
if (lastSelected.length) { |
|
167 |
lastSelected.after(this); |
|
168 |
} else { |
|
169 |
var parent = this.parentNode; |
|
170 |
jQuery(parent).prepend(this); |
|
171 |
} |
|
172 |
jQuery(this).addClass('facetValueSelected'); |
|
2325
363b66a15668
[cleaning] minor cleaning over last two checkins
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2324
diff
changeset
|
173 |
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
|
174 |
$img.attr('src', SELECTED_IMG).attr('alt', (_('selected'))); |
0 | 175 |
} |
1076
c510e1935ccc
new image for unchecked state
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
933
diff
changeset
|
176 |
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); |
0 | 177 |
facet.find('.facetBody').animate({scrollTop: 0}, ''); |
178 |
}); |
|
179 |
facet.find('select.facetOperator').change(function() { |
|
180 |
var nbselected = facet.find('div.facetValueSelected').length; |
|
181 |
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
|
182 |
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); |
0 | 183 |
} |
184 |
}); |
|
185 |
facet.find('div.facetTitle').click(function() { |
|
186 |
facet.find('div.facetBody').toggleClass('hidden').toggleClass('opened'); |
|
187 |
jQuery(this).toggleClass('opened'); |
|
188 |
}); |
|
189 |
||
190 |
}); |
|
191 |
} |
|
192 |
}); |
|
193 |
} |
|
194 |
||
195 |
// trigger this function on document ready event if you provide some kind of |
|
196 |
// persistent search (eg crih) |
|
197 |
function reorderFacetsItems(root){ |
|
198 |
root = root || document; |
|
199 |
jQuery(root).find('form').each(function () { |
|
200 |
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
|
201 |
if (form.attr('cubicweb:facetargs')) { |
0 | 202 |
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
|
203 |
var facet = jQuery(this); |
0 | 204 |
var lastSelected = null; |
205 |
facet.find('div.facetCheckBox').each(function (i) { |
|
206 |
var $this = jQuery(this); |
|
207 |
if ($this.hasClass('facetValueSelected')) { |
|
208 |
if (lastSelected) { |
|
209 |
lastSelected.after(this); |
|
210 |
} else { |
|
211 |
var parent = this.parentNode; |
|
212 |
jQuery(parent).prepend(this); |
|
213 |
} |
|
214 |
lastSelected = $this; |
|
215 |
} |
|
216 |
}); |
|
217 |
}); |
|
218 |
} |
|
219 |
}); |
|
220 |
} |
|
221 |
||
222 |
// we need to differenciate cases where initFacetBoxEvents is called |
|
223 |
// with one argument or without any argument. If we use `initFacetBoxEvents` |
|
224 |
// as the direct callback on the jQuery.ready event, jQuery will pass some argument |
|
225 |
// of his, so we use this small anonymous function instead. |
|
226 |
jQuery(document).ready(function() {initFacetBoxEvents();}); |
|
227 |
||
3006
4d85386b06a5
rename cubicweb.formfilter.js into cubicweb.facets.js
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2342
diff
changeset
|
228 |
CubicWeb.provide('facets.js'); |