diff options
| author | Christophe Matthieu <chm@odoo.com> | 2015-04-27 12:54:21 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2015-05-04 12:24:52 +0200 |
| commit | ce114bebd85ffd0b7e4c6a9779693e0ae87e2207 (patch) | |
| tree | 535a42b70b1f5f543ab7a81b889a0f791e7128a7 /addons/web/static/src | |
| parent | 81d57c1cee842b8f9c24417eb50a75e0c9f227e3 (diff) | |
[IMP] test_new_api: add field and template to test the X2many communication between web client and server side
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/tour.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/form_relational_widgets.js | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/static/src/js/tour.js b/addons/web/static/src/js/tour.js index b5cb3a8cfbb..ea64a55f22c 100644 --- a/addons/web/static/src/js/tour.js +++ b/addons/web/static/src/js/tour.js @@ -56,6 +56,9 @@ $.extend($.expr[':'],{ propValue: function(element, index, matches) { return $(element).prop("value") === matches[3]; }, + propValueContains: function(element, index, matches) { + return $(element).prop("value") && $(element).prop("value").indexOf(matches[3]) !== -1; + }, }); $.ajaxSetup({ beforeSend:function(){ @@ -655,6 +658,9 @@ var Tour = { click_event("mousedown"); click_event("mouseup"); click_event("click"); + if ($element.is("input, textarea, select") && !$element.is(":focus")) { + $element.focus(); + } // trigger after for step like: mouseenter, next step click on button display with mouseenter setTimeout(function () { @@ -663,7 +669,6 @@ var Tour = { }, self.defaultDelay<<1); } if (step.sampleText) { - $element.trigger($.Event("keydown", { srcElement: $element[0] })); if ($element.is("input") || $element.is('textarea')) { $element.val(step.sampleText); diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index 9357badcef1..a6ffcd3d058 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -926,9 +926,8 @@ var One2ManyListView = ListView.extend({ this._mousedown_blur_line = function (event) { if (self.__focus) { self.__ignore_blur = true; - var $dom = self.editor.$el.add(self.$el); if ($(event.target).closest("button, *:not(.oe_form_field_one2many_list_row_add) > a").length || - ($dom.index(event.target) === -1 && !_.any($(event.target).parents(), function (p) { return $dom.index(p) !== -1 ; }))) { + (!$(event.target).closest(self.editor.$el[0]).length && !$(event.target).closest(self.$el[0]).length)) { self.__ignore_blur = false; } } |
