Merge lp:~openerp-dev/openerp-web/7.0-opw-587544-cpa into lp:openerp-web/7.0

Proposed by Chirag Patel (OpenERP)
Status: Rejected
Rejected by: Christophe Matthieu (OpenERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-587544-cpa
Merge into: lp:openerp-web/7.0
Diff against target: 127 lines (+99/-1)
3 files modified
addons/web/__openerp__.py (+1/-0)
addons/web/static/lib/jquery.actual/jquery.actual.js (+97/-0)
addons/web/static/lib/jquery.textext/jquery.textext.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-587544-cpa
Reviewer Review Type Date Requested Status
Christophe Matthieu (OpenERP) (community) Disapprove
Review via email: mp+154931@code.launchpad.net

Description of the change

Hello,

M2m field wrong height count when field in nonactive notebook page at load time.

Demo: Sales > Sales orders
1) Create new sales order
2) Open notebook page "Other Information"

Observed: "Categories" field overlappping "Source Document".

m2m field in second page and page is nonactive so field is hidden.
jQuery always gives 0 when we try to find height of hidden element.
so find the actual height of element actual.js added.

Thanks

To post a comment you must log in.
Revision history for this message
Christophe Matthieu (OpenERP) (chm-openerp) wrote :

Hi,
No need lib.
Already fixed with "min-height: 22px"
Thanks

review: Disapprove

Unmerged revisions

3855. By Chirag Patel (OpenERP)

[FIX] Fixed m2m field wrong height count when field in nonactive notebook page.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/__openerp__.py'
--- addons/web/__openerp__.py 2013-03-20 14:36:52 +0000
+++ addons/web/__openerp__.py 2013-03-22 12:16:24 +0000
@@ -58,6 +58,7 @@
58 "static/src/js/view_list.js",58 "static/src/js/view_list.js",
59 "static/src/js/view_list_editable.js",59 "static/src/js/view_list_editable.js",
60 "static/src/js/view_tree.js",60 "static/src/js/view_tree.js",
61 "static/lib/jquery.actual/jquery.actual.js",
61 ],62 ],
62 'css' : [63 'css' : [
63 "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",64 "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",
6465
=== added directory 'addons/web/static/lib/jquery.actual'
=== added file 'addons/web/static/lib/jquery.actual/jquery.actual.js'
--- addons/web/static/lib/jquery.actual/jquery.actual.js 1970-01-01 00:00:00 +0000
+++ addons/web/static/lib/jquery.actual/jquery.actual.js 2013-03-22 12:16:24 +0000
@@ -0,0 +1,97 @@
1/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
2* Licensed under the MIT License (LICENSE.txt).
3*
4* Version: 1.0.14
5*
6* Requires: jQuery 1.2.3 ~ 1.9.0
7*/
8;( function ( $ ){
9 $.fn.extend({
10 actual : function ( method, options ){
11 // check if the jQuery method exist
12 if( !this[ method ]){
13 throw '$.actual => The jQuery method "' + method + '" you called does not exist';
14 }
15
16 var defaults = {
17 absolute : false,
18 clone : false,
19 includeMargin : false
20 };
21
22 var configs = $.extend( defaults, options );
23
24 var $target = this.eq( 0 );
25 var fix, restore;
26
27 if( configs.clone === true ){
28 fix = function (){
29 var style = 'position: absolute !important; top: -1000 !important; ';
30
31 // this is useful with css3pie
32 $target = $target.
33 clone().
34 attr( 'style', style ).
35 appendTo( 'body' );
36 };
37
38 restore = function (){
39 // remove DOM element after getting the width
40 $target.remove();
41 };
42 }else{
43 var tmp = [];
44 var style = '';
45 var $hidden;
46
47 fix = function (){
48 // get all hidden parents
49 if ($.fn.jquery >= "1.8.0")
50 $hidden = $target.parents().addBack().filter( ':hidden' );
51 else
52 $hidden = $target.parents().andSelf().filter( ':hidden' );
53
54 style += 'visibility: hidden !important; display: block !important; ';
55
56 if( configs.absolute === true ) style += 'position: absolute !important; ';
57
58 // save the origin style props
59 // set the hidden el css to be got the actual value later
60 $hidden.each( function (){
61 var $this = $( this );
62
63 // Save original style. If no style was set, attr() returns undefined
64 tmp.push( $this.attr( 'style' ));
65 $this.attr( 'style', style );
66 });
67 };
68
69 restore = function (){
70 // restore origin style values
71 $hidden.each( function ( i ){
72 var $this = $( this );
73 var _tmp = tmp[ i ];
74
75 if( _tmp === undefined ){
76 $this.removeAttr( 'style' );
77 }else{
78 $this.attr( 'style', _tmp );
79 }
80 });
81 };
82 }
83
84 fix();
85 // get the actual value with user specific methed
86 // it can be 'width', 'height', 'outerWidth', 'innerWidth'... etc
87 // configs.includeMargin only works for 'outerWidth' and 'outerHeight'
88 var actual = /(outer)/g.test( method ) ?
89 $target[ method ]( configs.includeMargin ) :
90 $target[ method ]();
91
92 restore();
93 // IMPORTANT, this plugin only return the value of the first element
94 return actual;
95 }
96 });
97})( jQuery );
098
=== modified file 'addons/web/static/lib/jquery.textext/jquery.textext.js'
--- addons/web/static/lib/jquery.textext/jquery.textext.js 2012-06-27 14:47:31 +0000
+++ addons/web/static/lib/jquery.textext/jquery.textext.js 2013-03-22 12:16:24 +0000
@@ -976,7 +976,7 @@
976976
977 self.trigger(EVENT_PRE_INVALIDATE);977 self.trigger(EVENT_PRE_INVALIDATE);
978978
979 height = input.outerHeight();979 height = input.actual('outerHeight');
980980
981 input.width(width);981 input.width(width);
982 wrap.width(width).height(height);982 wrap.width(width).height(height);