From ba2697d34466fc19e5be5335a960ac4d6477c32f Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Fri, 19 Oct 2012 16:47:39 +0530 Subject: [PATCH 1/4] [IMP] Improved code for red button bounce effect when click on non-editable status bars bzr revid: pan@tinyerp.com-20121019111739-3snflq85acs4nxt6 --- addons/web/static/src/js/view_form.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d096e15b51d..19f68a575de 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -207,12 +207,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } }); //bounce effect on red button when click on statusbar. - this.$el.find(".oe_form_field_status:not(.oe_form_status_clickable)").on('click', function (e) { - if((self.get("actual_mode") == "view")) { - var $button = self.$el.find(".oe_highlight:not(.oe_form_invisible)").css({'float':'left','clear':'none'}); + $(".oe_highlight:not(.oe_form_invisible)").wrap(""); + $(".oe_form_field_status:not(.oe_form_status_clickable)").on('click',function (e) { + // if((self.get("actual_mode") == "view")) { + var $button = $(".oe_highlight:not(.oe_form_invisible)")/*.css({'float':'left','white-space':'nowrap'})*/; $button.effect('bounce', {distance:18, times: 5}, 150); e.stopPropagation(); - } + // } }); this.trigger('form_view_loaded', data); return $.when(); From d6c28e5be7a0c4550d0e2b9cf8b241f52fb444a0 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Mon, 22 Oct 2012 10:48:02 +0530 Subject: [PATCH 2/4] [IMP]More clean code bzr revid: pan@tinyerp.com-20121022051802-forh9rhexkd2x2y0 --- addons/web/static/src/js/view_form.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 9c5c40a321c..57620a9856f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -209,11 +209,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM //bounce effect on red button when click on statusbar. $(".oe_highlight:not(.oe_form_invisible)").wrap(""); $(".oe_form_field_status:not(.oe_form_status_clickable)").on('click',function (e) { - // if((self.get("actual_mode") == "view")) { - var $button = $(".oe_highlight:not(.oe_form_invisible)")/*.css({'float':'left','white-space':'nowrap'})*/; + var $button = $(".oe_highlight:not(.oe_form_invisible)"); $button.effect('bounce', {distance:18, times: 5}, 150); e.stopPropagation(); - // } }); this.trigger('form_view_loaded', data); return $.when(); From 0e82e9aa172b7464681d66c5dd5f8025d0a14118 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Mon, 22 Oct 2012 18:48:42 +0530 Subject: [PATCH 3/4] Improved code for red_button_bounce effect bzr revid: pan@tinyerp.com-20121022131842-35qifgzyqkpviy4l --- addons/web/static/src/js/view_form.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 57620a9856f..5d7bf68920d 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -207,13 +207,17 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } }); //bounce effect on red button when click on statusbar. - $(".oe_highlight:not(.oe_form_invisible)").wrap(""); - $(".oe_form_field_status:not(.oe_form_status_clickable)").on('click',function (e) { - var $button = $(".oe_highlight:not(.oe_form_invisible)"); - $button.effect('bounce', {distance:18, times: 5}, 150); - e.stopPropagation(); - }); + this.on('load_record',this,function(){ + self.$el.find(".oe_form_field_status:not(.oe_form_status_clickable)").on('click',function (e) { + if(self.get("actual_mode") == "view") { + var $button = $(".oe_button.oe_form_button.oe_highlight:not(.oe_form_invisible)").wrap(""); + $button.effect('bounce', {distance:18, times: 5}, 150); + e.stopImmediatePropagation(); + } + }); + }) this.trigger('form_view_loaded', data); + return $.when(); }, widgetFocused: function() { From 8351473832502b236f2232e6c7d2bc2a5c663a8f Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Tue, 23 Oct 2012 12:32:06 +0530 Subject: [PATCH 4/4] [IMP]Improved code for red_button bounce effecct on statusbar click bzr revid: pan@tinyerp.com-20121023070206-a5xbxbyut3ytgrs5 --- addons/web/static/src/js/view_form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 30415be507f..7bb25d8bc4d 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -206,10 +206,10 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } }); //bounce effect on red button when click on statusbar. - this.on('load_record',this,function(){ + this.on('load_record',this,function(){ + var $button = self.$el.find(".oe_button.oe_form_button.oe_highlight:not(.oe_form_invisible)").css({'margin-left':'2px','float':'left','white-space':'nowrap'}); self.$el.find(".oe_form_field_status:not(.oe_form_status_clickable)").on('click',function (e) { if(self.get("actual_mode") == "view") { - var $button = $(".oe_button.oe_form_button.oe_highlight:not(.oe_form_invisible)").wrap(""); $button.effect('bounce', {distance:18, times: 5}, 150); e.stopImmediatePropagation(); }