[ADD] support for arguments-less onchange (why the hell not)
bzr revid: xmo@openerp.com-20111121122845-98lctm470ncttz74
This commit is contained in:
parent
95e2fcf884
commit
9d09c570ae
|
@ -250,8 +250,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
|
|||
return null;
|
||||
}
|
||||
|
||||
var method = call[1], args = [];
|
||||
var context_index = null;
|
||||
var method = call[1], args = [], context_index = null;
|
||||
if (!_.str.trim(call[2])) {
|
||||
return {method: method, args: args, context_index: context_index}
|
||||
}
|
||||
|
||||
var argument_replacement = {
|
||||
'False': function () {return false;},
|
||||
'True': function () {return true;},
|
||||
|
|
|
@ -22,12 +22,12 @@ $(document).ready(function () {
|
|||
window.openerp.web.form(openerp);
|
||||
}
|
||||
});
|
||||
// test('Parse args-less onchange', function () {
|
||||
// var f = new openerp.web.FormView(null, {});
|
||||
// var result = f.parse_on_change('on_change_foo()', {});
|
||||
// equal(result.method, 'on_change_foo');
|
||||
// deepEqual(result.args, []);
|
||||
// });
|
||||
test('Parse args-less onchange', function () {
|
||||
var f = new openerp.web.FormView(null, {});
|
||||
var result = f.parse_on_change('on_change_foo()', {});
|
||||
equal(result.method, 'on_change_foo');
|
||||
deepEqual(result.args, []);
|
||||
});
|
||||
test('Parse 1-arg onchange', function () {
|
||||
var f = make_form({foo: 3});
|
||||
var result = f.parse_on_change('on_change_foo(foo)', {});
|
||||
|
|
Loading…
Reference in New Issue