summaryrefslogtreecommitdiff
path: root/addons/google_docs/static/src/js
diff options
context:
space:
mode:
authorRoberto López López (OpenERP) <rlo@openerp.com>2012-02-27 17:12:00 +0100
committerRoberto López López (OpenERP) <rlo@openerp.com>2012-02-27 17:12:00 +0100
commitf0a9682a6aa6814817cca4e31fe9561bed60d126 (patch)
treed4e0ba1bcf5e65c8addedbc4d16a7d47c65ec8ef /addons/google_docs/static/src/js
parent3568bed68046537878e7386597abfb7978de3cdb (diff)
[imp] js things
bzr revid: rlo@openerp.com-20120227161200-toovqcewybgxsitg
Diffstat (limited to 'addons/google_docs/static/src/js')
-rw-r--r--addons/google_docs/static/src/js/gdocs.js28
1 files changed, 8 insertions, 20 deletions
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js
index 14996da46a5..11690f70e2a 100644
--- a/addons/google_docs/static/src/js/gdocs.js
+++ b/addons/google_docs/static/src/js/gdocs.js
@@ -1,22 +1,16 @@
-openerp.gdocs = function(instance) {
+console.log('fegegegwnw')
+openerp.google_docs = function(instance) {
+console.log('nw')
instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.extend({
- on_attachments_loaded: function(attachments) {
- this._super(attachments);
- var self = this;
- var $gdocbtn = self.$element.find('button.gdocs');
- var is_gdoc = function(a) {
- return a.type == 'url' && a.name == 'GDocs';
- };
- if (_.any(attachments, is_gdoc)) {
- $gdocbtn.hide();
- } else {
- $gdocbtn.show().click(self.on_add_gdoc);
- }
+ init: function() {
+ this._super.apply(this, arguments);
+ this.$element.delegate('.oe_google_docs_button', 'click', self.on_add_gdoc);
},
on_add_gdoc: function() {
var self = this;
- var $gdocbtn = this.$element.find('button.gdocs');
+console.log('--------');
+ var $gdocbtn = this.$element.find('.oe_google_docs_button');
$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,9 +22,3 @@ instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.exte
};
-$(function() {
- console.log($('#gd-button'));
- $('#gd-button').click(function(){alert('click');});
- alert('binded');
-}
-);