diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 1a7e30b5a84..0d79e783370 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2367,3 +2367,7 @@ div.ui-widget-overlay { filter: alpha(opacity=30); opacity: 0.3; } +.openerp .oe_bounce_button_left { + float: left; + margin-right: 4px; +} \ No newline at end of file diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 1ed4c4788e3..a200f272a91 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -728,6 +728,12 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { } return false; }, + /** + * Add bounce effect when click on wrong area + */ + do_bounce: function(element) { + element.effect("bounce", { times:3}, 300); + }, do_notify: function() { if (this.getParent()) { return this.getParent().do_notify.apply(this,arguments); @@ -740,6 +746,7 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { } return false; }, + rpc: function(url, data, success, error) { var def = $.Deferred().then(success, error); var self = this; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d629b8e9b3d..2a4b707f71e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -92,7 +92,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this._super(); }, on_loaded: function(data) { - var self = this; + var self = this; if (!data) { throw new Error("No data provided."); } @@ -284,8 +284,21 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } this._super(); }, + on_invalidclick : function (){ + var self = this; + var div = $("
", {id:"bounce"}); + this.$element.find(".oe_form_field, .oe_form_group_cell").click(function (e) { + $(".oe_form_button_edit").wrap(div); + $("#bounce").addClass('oe_bounce_button_left'); + var val_bounce = $(".oe_form_button_edit"); + self.do_bounce(val_bounce); + e.stopImmediatePropagation(); + }); + + }, on_record_loaded: function(record) { - var self = this, set_values = []; + var self = this, set_values = []; + self.on_invalidclick(); if (!record) { this.do_warn("Form", "The record could not be found in the database.", true); return $.Deferred().reject(); @@ -327,6 +340,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } self.$element.add(self.$buttons).removeClass('oe_form_dirty'); }); + }, on_form_changed: function() { this.trigger("view_content_has_changed"); @@ -585,9 +599,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM on_button_save: function() { var self = this; return this.do_save().then(function(result) { - self.set({mode: "view"}); + self.set({mode: "view"}); + self.on_invalidclick(); }); - }, + + }, on_button_cancel: function(event) { if (this.can_be_discarded()) { this.set({mode: "view"}); @@ -2980,7 +2996,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ return def; }, reload_current_view: function() { - var self = this; + var self = this; return self.is_loaded = self.is_loaded.pipe(function() { var active_view = self.viewmanager.active_view; var view = self.viewmanager.views[active_view].controller; diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 3033404b387..7bf9d4ad6bf 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -287,6 +287,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi this.$element.find('.oe_list_buttons').replaceWith(this.$buttons); } this.$buttons.find('.oe_list_add') + .wrap("
") + .addClass('oe_bounce_button_left') .click(this.proxy('do_add_record')) .prop('disabled', grouped && this.options.editable); this.$buttons.on('click', '.oe_list_button_import', function() { @@ -983,6 +985,12 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. } self.row_clicked(e); } + else{ + if (opts.options.$buttons){ + var bounce_val = $(opts.options.$buttons.find('.oe_list_add')); + self.view.do_bounce(bounce_val); + } + } }); }, row_clicked: function (e, view) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index a8d7a061a81..f150e47b420 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -681,7 +681,7 @@
- + diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index f16bd58bc5e..c5c4a8222db 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -514,8 +514,10 @@ .openerp .oe_kanban_view .oe_kanban_color_9 { background-color: #ffc7f1; } - .openerp .oe_form .oe_kanban_view .oe_kanban_column, .openerp .oe_form .oe_kanban_view .oe_kanban_group_header { padding: 0px; background: white; } +.openerp .oe_kanban_quick_create_bounce { + float: right; +} \ No newline at end of file diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index bb162baa321..56612f3bf08 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -415,6 +415,15 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({ self.quick.appendTo($(".oe_kanban_group_list_header", self.$records)); self.quick.focus(); }); + var click_column = this.$element.find('.oe_kanban_add'); + click_column.addClass('oe_kanban_quick_create_bounce'); + this.$records.click(function(e) { + var $target = e.target; + var $currenttarget = e.currentTarget; + if ($target == $currenttarget) { + self.view.do_bounce(click_column); + } + }); this.$records.find('.oe_kanban_show_more').click(this.do_show_more); if (this.state.folded) { this.do_toggle_fold();