[components] fix HideAsidesBar component (closes #3737557)

  • the contentCol carring layout information (class="col-dm-X") is now div#main-center instead of div#pageContent (see cset 1545a8e37c6c)
  • HideLeftBar is renamed into HideAsidesBar
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
changeset2daaef797ecf
branchdefault
phasepublic
hiddenno
parent revision#91f52a3acd47 Added tag cubicweb-squareui-centos-version-0.3.2-1, cubicweb-squareui-version-0.3.2, cubicweb-squareui-debian-version-0.3.2-1 for changeset 4741ac6e2748
child revision#bad81249f6cc [pkg] Prepare 0.3.3 release, #2e5d1b808849 [pkg] prepare 0.3.3
files modified by this revision
data/cubes.squareui.js
views/basetemplates.py
views/component.py
# HG changeset patch
# User Katia Saurfelt <katia.saurfelt@logilab.fr>
# Date 1397125795 -7200
# Thu Apr 10 12:29:55 2014 +0200
# Node ID 2daaef797ecf8cd3f5ac9e883284f01909a94364
# Parent 91f52a3acd47c78a47ae38726ae3cc8cffe1deeb
[components] fix HideAsidesBar component (closes #3737557)

* the contentCol carring layout information (class="col-dm-X")
is now div#main-center instead of div#pageContent (see cset 1545a8e37c6c)

* HideLeftBar is renamed into HideAsidesBar

diff --git a/data/cubes.squareui.js b/data/cubes.squareui.js
@@ -12,11 +12,11 @@
1          }
2          return data;
3      },
4 
5      toggleLeftColumn: function (toggle) {
6 -        var $contentCol = $('#pageContent');
7 +        var $contentCol = $('#main-center');
8          var $asideCols = $(".cwjs-aside");
9          if ($asideCols.length) {
10              var collapsendContentClass = 'col-md-' + (12 - $asideCols.length * 3);
11              var fullContentClass = 'col-md-12';
12              var displayAsideboxes = cw.cubes.squareui.getLocalData('asideboxes');
@@ -36,11 +36,11 @@
13 
14  });
15 
16  $(document).ready(function () {
17      if ($('#cw-aside-toggle').length) {
18 -        // if HideLeftBar component is activated
19 +        // if HideAsidesBar component is activated
20          var displayAsideboxes = cw.cubes.squareui.getLocalData('asideboxes');
21          if (displayAsideboxes !== undefined) {
22              cw.cubes.squareui.toggleLeftColumn(displayAsideboxes);
23          }
24      }
diff --git a/views/basetemplates.py b/views/basetemplates.py
@@ -128,11 +128,11 @@
25      return len(boxes)
26 
27  @monkeypatch(basetemplates.TheMainTemplate)
28  def content_column(self, view, content_cols):
29      w = self.w
30 -    w(u'<div class="col-md-%(col)s" role="main">' % {
31 +    w(u'<div id="main-center" class="col-md-%(col)s" role="main">' % {
32          'col': content_cols})
33      w(u'<div id="pageContent">')
34      components = self._cw.vreg['components']
35      self.content_components(view, components)
36      self.content_header(view)
diff --git a/views/component.py b/views/component.py
@@ -18,11 +18,11 @@
37  from logilab.common.registry import yes
38 
39  from cubicweb.web.views.basecomponents import HeaderComponent
40 
41 
42 -class HideLeftBar(HeaderComponent):
43 +class HideAsidesBar(HeaderComponent):
44      """ Hide the left bar """
45      __regid__ = 'hide-left-bar'
46      __select__ = yes()
47      context = 'header-right'
48      order = 3