Jiten (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-useability-effect-bounce into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-useability-effect-bounce/+merge/114342

Improved code to add bounce effect when click on wrong area.
- When we click on empty row of list view than 'Create' button should be bounce 
to give hint to user.
- When we click on content of field on page view (readonly) than 'Edit' button 
should be bounce.
- In Kanban view for m2o grouped column, When we click on empty space than '+' 
button should be bounce.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-useability-effect-bounce/+merge/114342
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-useability-effect-bounce.
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2012-07-10 10:13:18 +0000
+++ addons/web/static/src/css/base.css	2012-07-11 06:55:44 +0000
@@ -2367,3 +2367,7 @@
   filter: alpha(opacity=30);
   opacity: 0.3;
 }
+.openerp .oe_bounce_button_left {
+  float: left;
+  margin-right: 4px;
+}
\ No newline at end of file

=== modified file 'addons/web/static/src/js/corelib.js'
--- addons/web/static/src/js/corelib.js	2012-07-03 15:14:01 +0000
+++ addons/web/static/src/js/corelib.js	2012-07-11 06:55:44 +0000
@@ -728,6 +728,12 @@
         }
         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 @@
         }
         return false;
     },
+    
     rpc: function(url, data, success, error) {
         var def = $.Deferred().then(success, error);
         var self = this;

=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2012-07-10 09:18:21 +0000
+++ addons/web/static/src/js/view_form.js	2012-07-11 06:55:44 +0000
@@ -284,8 +284,20 @@
         }
         this._super();
     },
+    on_wrong_click : function (){
+        var self = this;
+        var div = $("<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 edit_btn = $(".oe_form_button_edit");
+            self.do_bounce(edit_btn);
+            e.stopImmediatePropagation();
+        });
+    },
     on_record_loaded: function(record) {
         var self = this, set_values = [];
+        self.on_wrong_click();
         if (!record) {
             this.do_warn("Form", "The record could not be found in the database.", true);
             return $.Deferred().reject();
@@ -327,6 +339,7 @@
             }
             self.$element.add(self.$buttons).removeClass('oe_form_dirty');
         });
+          
     },
     on_form_changed: function() {
         this.trigger("view_content_has_changed");
@@ -586,8 +599,10 @@
         var self = this;
         return this.do_save().then(function(result) {
             self.set({mode: "view"});
+            self.on_wrong_click();
         });
-    },
+        
+    },    
     on_button_cancel: function(event) {
         if (this.can_be_discarded()) {
             this.set({mode: "view"});

=== modified file 'addons/web/static/src/js/view_list.js'
--- addons/web/static/src/js/view_list.js	2012-07-03 15:55:40 +0000
+++ addons/web/static/src/js/view_list.js	2012-07-11 06:55:44 +0000
@@ -287,6 +287,8 @@
                 this.$element.find('.oe_list_buttons').replaceWith(this.$buttons);
             }
             this.$buttons.find('.oe_list_add')
+                    .wrap("<div></div>")
+                    .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() {
@@ -982,7 +984,12 @@
                         throw "Could not find id in dataset"
                     }
                     self.row_clicked(e);
-                }
+                } else {
+                    if (opts.options.$buttons) {
+                        var create_btn = $(opts.options.$buttons.find('.oe_list_add'));
+                        self.view.do_bounce(create_btn);
+                    }
+               }
             });
     },
     row_clicked: function (e, view) {

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2012-07-10 10:12:05 +0000
+++ addons/web/static/src/xml/base.xml	2012-07-11 06:55:44 +0000
@@ -681,7 +681,7 @@
 </t>
 <div t-name="FormView.buttons" class="oe_form_buttons">
     <t t-if="widget.options.action_buttons !== false">
-        <span class="oe_form_buttons_view">
+        <span class="oe_form_buttons_view">            
             <button type="button" class="oe_button oe_form_button_edit">Edit</button>
             <button type="button" class="oe_button oe_form_button_create">Create</button>
         </span>

=== modified file 'addons/web_kanban/static/src/css/kanban.css'
--- addons/web_kanban/static/src/css/kanban.css	2012-07-10 15:03:13 +0000
+++ addons/web_kanban/static/src/css/kanban.css	2012-07-11 06:55:44 +0000
@@ -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

=== modified file 'addons/web_kanban/static/src/js/kanban.js'
--- addons/web_kanban/static/src/js/kanban.js	2012-07-05 12:22:59 +0000
+++ addons/web_kanban/static/src/js/kanban.js	2012-07-11 06:55:44 +0000
@@ -415,6 +415,12 @@
             self.quick.appendTo($(".oe_kanban_group_list_header", self.$records));
             self.quick.focus();
         });
+        var add_btn = this.$element.find('.oe_kanban_add');
+        this.$records.click(function (ev) {
+            if (ev.target == ev.currentTarget) {
+                self.view.do_bounce(add_btn);
+            }
+        });
         this.$records.find('.oe_kanban_show_more').click(this.do_show_more);
         if (this.state.folded) {
             this.do_toggle_fold();

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to