[facets,js] fix bogus checkbox icon appearing after the first interaction (closes #2790332) stable
authorDavid Douard <david.douard@logilab.fr>
Mon, 22 Jul 2013 15:38:11 +0200
branchstable
changeset 9176 8139f82c8bbe
parent 9175 a7412e884d7b
child 9177 5236d0e4c598
[facets,js] fix bogus checkbox icon appearing after the first interaction (closes #2790332) This is because of the hardcoding of the data/ url.
web/data/cubicweb.facets.js
web/views/basetemplates.py
--- 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')