added a bounce effect when On non editable page view, if click on the content of a field, bounce the Edit button

bzr revid: pan@tinyerp.com-20120628114609-xmj17x8t2pymftcf
This commit is contained in:
Anand Patel (OpenERP)
2012-06-28 17:16:09 +05:30
parent ff179d6b98
commit 693ec72528
3 changed files with 11 additions and 2 deletions
+3
View File
@@ -2216,3 +2216,6 @@
.kitten-mode-activated > * {
opacity: 0.7;
}
.openerp .bounce {
float:left;
}
+7 -1
View File
@@ -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.");
}
@@ -286,6 +286,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
},
on_record_loaded: function(record) {
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();
@@ -581,6 +582,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
self.set({mode: "view"});
});
},
on_invalidclick: function() {
this.$element.find(".oe_form_field").click(function () {
$(".oe_form_button_edit").effect("bounce", { times:3,distance:100 }, 500);
});
},
on_button_cancel: function(event) {
if (this.can_be_discarded()) {
this.set({mode: "view"});
+1 -1
View File
@@ -680,7 +680,7 @@
<div t-name="FormView.buttons" class="oe_form_buttons">
<t t-if="widget.options.action_buttons !== false">
<span class="oe_form_buttons_view">
<button type="button" class="oe_button oe_form_button_edit">Edit</button>
<div class="bounce"><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>
</span>
<span class="oe_form_buttons_edit">