# HG changeset patch # User RĂ©mi Cardona # Date 1401705472 -7200 # Node ID 3d3aa4dd6a323c5cbf2c8eaee0221e9cdcc490d1 # Parent d30ff49d4a941db691cb641622cda2fb8b17b29d [reledit] Fix reledit icons jumpiness (closes #4106867) Introduce an "invisible" class (copied verbatim from Bootstrap) that only sets the "visibility" property. "display: none" is the reason for the whole jumpiness as it actually detaches the element from the rendered layout. "visibility: hidden" only makes it transparent while keeping its original box properties (width, height, etc). diff -r d30ff49d4a94 -r 3d3aa4dd6a32 web/data/cubicweb.css --- a/web/data/cubicweb.css Mon Jun 02 12:29:37 2014 +0200 +++ b/web/data/cubicweb.css Mon Jun 02 12:37:52 2014 +0200 @@ -204,6 +204,11 @@ } /* copied verbatim from bootstrap 3.0 */ +.invisible { + visibility: hidden; +} + +/* copied verbatim from bootstrap 3.0 */ .list-unstyled { padding-left: 0; list-style: none; diff -r d30ff49d4a94 -r 3d3aa4dd6a32 web/data/cubicweb.old.css --- a/web/data/cubicweb.old.css Mon Jun 02 12:29:37 2014 +0200 +++ b/web/data/cubicweb.old.css Mon Jun 02 12:37:52 2014 +0200 @@ -220,6 +220,11 @@ } /* copied verbatim from bootstrap 3.0 */ +.invisible { + visibility: hidden; +} + +/* copied verbatim from bootstrap 3.0 */ .list-unstyled { padding-left: 0; list-style: none; diff -r d30ff49d4a94 -r 3d3aa4dd6a32 web/test/unittest_reledit.py --- a/web/test/unittest_reledit.py Mon Jun 02 12:29:37 2014 +0200 +++ b/web/test/unittest_reledit.py Mon Jun 02 12:37:52 2014 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -33,9 +33,9 @@ class ClickAndEditFormTC(ReleditMixinTC, CubicWebTC): def test_default_config(self): - reledit = {'title': '''
cubicweb-world-domination
''', - 'long_desc': '''
<not specified>
''', - 'manager': '''
<not specified>
''', + reledit = {'title': '''
cubicweb-world-domination
''', + 'long_desc': '''
<not specified>
''', + 'manager': '''
<not specified>
''', 'composite_card11_2ttypes': """<not specified>""", 'concerns': """<not specified>"""} @@ -49,7 +49,7 @@ def test_default_forms(self): self.skipTest('Need to check if this test should still run post reledit/doreledit merge') - doreledit = {'title': """
cubicweb-world-domination
+ doreledit = {'title': """
cubicweb-world-domination
@@ -78,12 +78,12 @@
-
""", +
""", - 'long_desc': """
<not specified>
+ 'long_desc': """
<not specified>
- - + + @@ -122,9 +122,9 @@
-
""", +
""", - 'manager': """
<not specified>
+ 'manager': """
<not specified>
@@ -158,7 +158,7 @@
-
""", +
""", 'composite_card11_2ttypes': """<not specified>""", 'concerns': """<not specified>""" } @@ -192,11 +192,11 @@ reledit_ctrl.tag_object_of(('Ticket', 'concerns', 'Project'), {'edit_target': 'rtype'}) reledit = { - 'title': """
cubicweb-world-domination
""", - 'long_desc': """
<long_desc is required>
""", - 'manager': """
""", + 'title': """
cubicweb-world-domination
""", + 'long_desc': """
<long_desc is required>
""", + 'manager': """
""", 'composite_card11_2ttypes': """<not specified>""", - 'concerns': """
""" + 'concerns': """
""" } for rschema, ttypes, role in self.proj.e_schema.relation_definitions(includefinal=True): if rschema not in reledit: diff -r d30ff49d4a94 -r 3d3aa4dd6a32 web/views/reledit.py --- a/web/views/reledit.py Mon Jun 02 12:29:37 2014 +0200 +++ b/web/views/reledit.py Mon Jun 02 12:37:52 2014 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -340,13 +340,13 @@ w = self.w w(u'
' % {'id': divid, 'css': 'releditField', - 'out': "jQuery('#%s').addClass('hidden')" % divid, - 'over': "jQuery('#%s').removeClass('hidden')" % divid}) + 'out': "jQuery('#%s').addClass('invisible')" % divid, + 'over': "jQuery('#%s').removeClass('invisible')" % divid}) w(u'
' % divid) w(value) w(u'
') form.render(w=w, renderer=renderer) - w(u'