[IMP] Improved code to create bounce effect by CSS.
bzr revid: jra@tinyerp.com-20120713130325-q0c6km66nkv2qi7p
This commit is contained in:
parent
a7f2511601
commit
3db53edefc
|
@ -2367,7 +2367,26 @@ div.ui-widget-overlay {
|
|||
filter: alpha(opacity=30);
|
||||
opacity: 0.3;
|
||||
}
|
||||
.openerp .oe_bounce_button_left {
|
||||
|
||||
.oe_bounce_left {
|
||||
float: left;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.openerp .oe_bounce {
|
||||
-moz-animation:bounce .40s linear;
|
||||
-webkit-animation:bounce .40s linear;
|
||||
}
|
||||
|
||||
@-moz-keyframes bounce {
|
||||
0%{ -moz-transform:scale(0); opacity:0;}
|
||||
50%{ -moz-transform:scale(1.3); opacity:0.4; }
|
||||
75%{ -moz-transform:scale(0.9); opacity:0.7;}
|
||||
100%{ -moz-transform:scale(1); opacity:1;}
|
||||
}
|
||||
|
||||
@-webkit-keyframes bounce {
|
||||
0%{ -webkit-transform:scale(0); opacity:0;}
|
||||
50%{ -webkit-transform:scale(1.3); opacity:0.4;}
|
||||
75%{ -webkit-transform:scale(0.9); opacity:0.7;}
|
||||
100%{ -webkit-transform:scale(1); opacity:1;}
|
||||
}
|
|
@ -728,12 +728,6 @@ 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);
|
||||
|
|
|
@ -564,8 +564,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
});
|
||||
var edit_btn = $(".oe_form_button_edit");
|
||||
this.$element.find(".oe_form_field, .oe_form_group_cell").click(function (e) {
|
||||
edit_btn.wrap("<div>").addClass('oe_bounce_button_left');
|
||||
self.do_bounce(edit_btn);
|
||||
edit_btn.wrap('<div>').css('margin-right','4px').addClass('oe_bounce_left oe_bounce');
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -984,8 +984,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
|||
self.row_clicked(e);
|
||||
} else if (opts.options.$buttons) {
|
||||
var create_btn = $(opts.options.$buttons.find('.oe_list_add'));
|
||||
create_btn..wrap("<div>").addClass('oe_bounce_button_left')
|
||||
self.view.do_bounce(create_btn);
|
||||
create_btn.wrap('<div>').css('margin-right','4px').addClass('oe_bounce_left oe_bounce');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -518,7 +518,4 @@
|
|||
.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;
|
||||
}
|
|
@ -420,10 +420,10 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
|
|||
this.$records.click(function (ev) {
|
||||
if (ev.target == ev.currentTarget) {
|
||||
if (!self.state.folded) {
|
||||
self.view.do_bounce(add_btn);
|
||||
add_btn.wrap('<div>').addClass('oe_bounce');
|
||||
}else {
|
||||
// fold_btn.css('display','inline-block');
|
||||
self.view.do_bounce(fold_btn);
|
||||
// fold_btn.css('display','inline-block');
|
||||
fold_btn.wrap('<div>').addClass('oe_bounce');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue