Merge lp:~unifield-team/unifield-web/oeb-181 into lp:unifield-web

Proposed by jftempo
Status: Merged
Merged at revision: 4715
Proposed branch: lp:~unifield-team/unifield-web/oeb-181
Merge into: lp:unifield-web
Diff against target: 87 lines (+22/-1)
4 files modified
addons/openerp/controllers/templates/form.mako (+3/-0)
addons/openerp/static/javascript/listgrid.js (+6/-1)
addons/openerp/static/javascript/o2m.js (+10/-0)
addons/openerp/widgets/_interface.py (+3/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/oeb-181
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+184090@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/templates/form.mako'
2--- addons/openerp/controllers/templates/form.mako 2012-06-29 09:38:15 +0000
3+++ addons/openerp/controllers/templates/form.mako 2013-09-05 12:40:45 +0000
4@@ -25,6 +25,9 @@
5 /*
6 % endif
7 */
8+ setTimeout(function() {
9+ jQuery('[autofocus="autofocus"]').focus();
10+ }, 10);
11 });
12 </script>
13
14
15=== modified file 'addons/openerp/static/javascript/listgrid.js'
16--- addons/openerp/static/javascript/listgrid.js 2012-03-14 17:30:39 +0000
17+++ addons/openerp/static/javascript/listgrid.js 2013-09-05 12:40:45 +0000
18@@ -839,7 +839,12 @@
19
20 // set focus on the first field
21 var first = jQuery('input.listfields')[0] || null;
22- if (first) {
23+ var autofocus = jQuery("[autofocus='autofocus']");
24+ if (autofocus.length && edit_inline) {
25+ autofocus.focus();
26+ autofocus.select();
27+ }
28+ else if (first) {
29 first.focus();
30 first.select();
31 }
32
33=== modified file 'addons/openerp/static/javascript/o2m.js'
34--- addons/openerp/static/javascript/o2m.js 2012-07-03 08:32:48 +0000
35+++ addons/openerp/static/javascript/o2m.js 2013-09-05 12:40:45 +0000
36@@ -250,6 +250,10 @@
37 width: '90%',
38 height: '95%',
39 });
40+ $frame.load(function() {
41+ $frame_content = $frame.contents();
42+ $frame_content.find("[autofocus='autofocus']").focus();
43+ });
44 var $form = jQuery('<form>', {
45 method: 'POST',
46 action: '/openerp/openo2m/edit',
47@@ -279,6 +283,7 @@
48 var jQ = jQuery;
49 var $ = $frame_window[0].jQuery;
50
51+ $frame = $($frame_window.attr('frameElement'));
52 var $form = $('#view_form');
53
54 var list_id = frame_data($frame_window, 'list');
55@@ -300,6 +305,11 @@
56 })));
57 });
58
59+ setTimeout(function() {
60+ var $frame_content = $frame.contents();
61+ $frame_content.find("[autofocus='autofocus']").focus();
62+ }, 100);
63+
64 var lc = parseInt($('#_terp_load_counter').val(), 10) || 0;
65 if(lc) {
66 $.o2m('refresh');
67
68=== modified file 'addons/openerp/widgets/_interface.py'
69--- addons/openerp/widgets/_interface.py 2013-05-28 07:46:34 +0000
70+++ addons/openerp/widgets/_interface.py 2013-09-05 12:40:45 +0000
71@@ -167,6 +167,7 @@
72 self.callback = attrs.get('on_change', None)
73 self.kind = attrs.get('type', None)
74
75+ self.default_focus = attrs.get('default_focus', False)
76 self.label = self.label_type(self.name, self.string, self.help)
77 self.filters = []
78
79@@ -220,6 +221,8 @@
80 'onchange': self.onchange
81 })
82
83+ if self.default_focus:
84+ params['attrs']['autofocus'] = 'autofocus'
85 if self.readonly:
86 params['attrs']['disabled'] = 'disabled'
87 #if self.states:

Subscribers

People subscribed via source and target branches

to all changes: