[FIX] fixing bugs in bounce effects + cleaner effect

bzr revid: fp@tinyerp.com-20120808073821-gxp4r9u12160lshy
This commit is contained in:
Fabien Pinckaers 2012-08-08 09:38:21 +02:00
parent 3fdd2881b9
commit 175c167471
4 changed files with 14 additions and 14 deletions

View File

@ -435,9 +435,6 @@ $sheet-max-width: 860px
text-decoration: none text-decoration: none
.oe_star_on .oe_star_on
color: gold color: gold
.oe_bounce
-moz-animation: bounce .40s linear
-webkit-animation: bounce .40s linear
// }}} // }}}
// Tags (for many2many tags, among others) {{{ // Tags (for many2many tags, among others) {{{
.oe_tag .oe_tag

View File

@ -155,15 +155,16 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
]); ]);
} }
this.has_been_loaded.resolve();
// Add bounce effect on button 'Edit' when click on readonly page view. // Add bounce effect on button 'Edit' when click on readonly page view.
this.$element.find(".oe_form_field, .oe_form_group_cell").on('click', function (e) { this.$element.find(".oe_form_field,label").on('click', function (e) {
if(self.get("actual_mode") == "view") { if(self.get("actual_mode") == "view") {
var $button = self.options.$buttons.find(".oe_form_button_edit"); var $button = self.options.$buttons.find(".oe_form_button_edit");
$button.wrap('<div>').css('margin-right','4px').addClass('oe_left oe_bounce'); $button.effect('bounce', {distance: 18, times: 7}, 200)
} }
}); });
this.has_been_loaded.resolve();
return $.when(); return $.when();
}, },
extract_qweb_template: function(fvg) { extract_qweb_template: function(fvg) {

View File

@ -708,7 +708,9 @@
<div t-name="FormView.buttons" class="oe_form_buttons"> <div t-name="FormView.buttons" class="oe_form_buttons">
<t t-if="widget.options.action_buttons !== false"> <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> <div style="display: inline-block;"> <!-- required for the bounce effect on button -->
<button type="button" class="oe_button oe_form_button_edit">Edit</button>
</div>
<button type="button" class="oe_button oe_form_button_create">Create</button> <button type="button" class="oe_button oe_form_button_create">Create</button>
</span> </span>
<span class="oe_form_buttons_edit"> <span class="oe_form_buttons_edit">

View File

@ -421,13 +421,6 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
}); });
// Add bounce effect on image '+' of kanban header when click on empty space of kanban grouped column. // Add bounce effect on image '+' of kanban header when click on empty space of kanban grouped column.
var add_btn = this.$element.find('.oe_kanban_add'); var add_btn = this.$element.find('.oe_kanban_add');
this.$records.click(function (ev) {
if (ev.target == ev.currentTarget) {
if (!self.state.folded) {
add_btn.wrap('<div>').addClass('oe_bounce');
}
}
});
this.$records.find('.oe_kanban_show_more').click(this.do_show_more); this.$records.find('.oe_kanban_show_more').click(this.do_show_more);
if (this.state.folded) { if (this.state.folded) {
this.do_toggle_fold(); this.do_toggle_fold();
@ -436,6 +429,13 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
this.$records.data('widget', this); this.$records.data('widget', this);
this.$has_been_started.resolve(); this.$has_been_started.resolve();
this.compute_cards_auto_height(); this.compute_cards_auto_height();
this.$records.click(function (ev) {
if (ev.target == ev.currentTarget) {
if (!self.state.folded) {
add_btn.effect('bounce', {distance: 18, times: 7}, 200)
}
}
});
return def; return def;
}, },
compute_cards_auto_height: function() { compute_cards_auto_height: function() {