[facets,js] fix bogus checkbox icon appearing after the first interaction (closes #2790332)
This is because of the hardcoding of the data/ url.
--- a/web/data/cubicweb.facets.js Mon Jul 22 14:57:37 2013 +0200
+++ b/web/data/cubicweb.facets.js Mon Jul 22 15:38:11 2013 +0200
@@ -1,14 +1,13 @@
/** filter form, aka facets, javascript functions
*
* :organization: Logilab
- * :copyright: 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+ * :copyright: 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
* :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
*/
-var SELECTED_IMG = baseuri() + "data/black-check.png";
-var UNSELECTED_IMG = baseuri() + "data/no-check-no-border.png";
-var UNSELECTED_BORDER_IMG = baseuri() + "data/black-uncheck.png";
-
+var SELECTED_IMG = DATA_URL + 'black-check.png';
+var UNSELECTED_IMG = DATA_URL + 'no-check-no-border.png';
+var UNSELECTED_BORDER_IMG = DATA_URL + 'black-uncheck.png';
function copyParam(origparams, newparams, param) {
var index = $.inArray(param, origparams[0]);
--- a/web/views/basetemplates.py Mon Jul 22 14:57:37 2013 +0200
+++ b/web/views/basetemplates.py Mon Jul 22 15:38:11 2013 +0200
@@ -162,6 +162,7 @@
self.write_doctype()
# explictly close the <base> tag to avoid IE 6 bugs while browsing DOM
self._cw.html_headers.define_var('BASE_URL', self._cw.base_url())
+ self._cw.html_headers.define_var('DATA_URL', self._cw.datadir_url)
w(u'<meta http-equiv="content-type" content="%s; charset=%s"/>\n'
% (content_type, self._cw.encoding))
w(u'\n'.join(additional_headers) + u'\n')