[MERGE] Merged code for add bounce effect on click wrong area. (trainees-india)
bzr revid: jra@tinyerp.com-20120711062736-f09dplgywvn92mk7
This commit is contained in:
commit
ced66d4e23
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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 = $("<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;
|
||||
|
|
|
@ -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("<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() {
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue