[imp] view

bzr revid: rlo@openerp.com-20120227151311-38go1bn2ihs1n5jq
This commit is contained in:
Roberto López López (OpenERP)
2012-02-27 16:13:11 +01:00
parent 087c191730
commit 3568bed680
2 changed files with 16 additions and 3 deletions
+8 -2
View File
@@ -2,7 +2,6 @@ openerp.gdocs = function(instance) {
instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.extend({
on_attachments_loaded: function(attachments) {
alert('gdocs.js.on_attachments_loaded()');
this._super(attachments);
var self = this;
var $gdocbtn = self.$element.find('button.gdocs');
@@ -17,7 +16,7 @@ instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.exte
},
on_add_gdoc: function() {
var self = this;
var $gdocbtn = this.$element.find('button.gdocs');alert($gdocbtn);
var $gdocbtn = this.$element.find('button.gdocs');
$gdocbtn.attr('disabled', 'true').find('img, span').toggle();
this.view.dataset.call_button('copy_gdoc', [[this.view.datarecord.id], this.view.dataset.get_context()], function(r) {
$gdocbtn.hide();
@@ -28,3 +27,10 @@ instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.exte
});
};
$(function() {
console.log($('#gd-button'));
$('#gd-button').click(function(){alert('click');});
alert('binded');
}
);
+8 -1
View File
@@ -4,7 +4,14 @@
<templates id="template" xml:space="preserve">
<t t-extend="FormView.sidebar.attachments">
<t t-jquery="div.oe-binary-file-set" t-operation="append">
<button class="oe-button" type="button">
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<button class="oe-button" type="button" id='gd-button'>
<img src="/web/static/src/img/throbber.gif" width="16" height="16" style="display: none"/>
<span>Add GDoc</span>
</button>