diff options
| author | Christophe Matthieu <chm@openerp.com> | 2012-12-21 14:42:27 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2012-12-21 14:42:27 +0100 |
| commit | 558fcc4471f3b5bf4ee9675a36ad834d611d9fca (patch) | |
| tree | f635a32b142d5fb4e0d6af545202ed85e98bcfeb /addons | |
| parent | f3a71a1dc3a82b09e62c366e025739941e94f3e8 (diff) | |
| parent | 86a1802556cae70401f450c15a9bd51f5ccf9249 (diff) | |
[MERGE] FIX etherpad:When: a user access to the edit mode from a kanban view or list view, etherpad is dipslay on readonly mode but with the oe_editing class.
bzr revid: chm@openerp.com-20121221134227-1nbb922oz37ibjw5
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/note/static/src/css/note.css | 4 | ||||
| -rw-r--r-- | addons/note/static/src/css/note.sass | 2 | ||||
| -rw-r--r-- | addons/note_pad/note_pad_view.xml | 2 | ||||
| -rw-r--r-- | addons/pad/static/src/js/pad.js | 16 |
4 files changed, 18 insertions, 6 deletions
diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css index 16d71e28aa5..ece2d7d5ffd 100644 --- a/addons/note/static/src/css/note.css +++ b/addons/note/static/src/css/note.css @@ -2,13 +2,15 @@ .oe_kanban_column .note_text_line_through { text-decoration: line-through; } - .openerp .oe_form .oe_form_field.oe_memo { margin: 0 -16px 0 -16px; padding: 0px; width: 100%; min-height: 200px; } +.openerp .oe_form .oe_pad.oe_memo { + width: auto; +} .openerp .oe_form .oe_form_field.oe_memo .cleditorMain { border: none; padding: 0px; diff --git a/addons/note/static/src/css/note.sass b/addons/note/static/src/css/note.sass index 6f0c0883ae7..f30ff7246e7 100644 --- a/addons/note/static/src/css/note.sass +++ b/addons/note/static/src/css/note.sass @@ -17,6 +17,8 @@ .openerp .oe_form + .oe_pad.oe_memo + width: auto .oe_form_field.oe_memo margin: 0 -16px 0 -16px padding: 0px diff --git a/addons/note_pad/note_pad_view.xml b/addons/note_pad/note_pad_view.xml index 9e45a3952f1..0032905b6b5 100644 --- a/addons/note_pad/note_pad_view.xml +++ b/addons/note_pad/note_pad_view.xml @@ -7,7 +7,7 @@ <field name="inherit_id" ref="note.view_note_note_form"/> <field name="arch" type="xml"> <field name="memo" position="replace"> - <field name="note_pad_url" widget="pad"/> + <field name="note_pad_url" widget="pad" class="oe_memo"/> </field> </field> </record> diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js index 9e1b73e1f3b..b96047340ad 100644 --- a/addons/pad/static/src/js/pad.js +++ b/addons/pad/static/src/js/pad.js @@ -4,6 +4,13 @@ openerp.pad = function(instance) { template: 'FieldPad', configured: false, content: "", + start: function() { + this._super(); + var self = this; + this.on('change:effective_readonly',this,function(){ + self.renderElement(); + }); + }, render_value: function() { var self = this; var _super = _.bind(this._super, this); @@ -27,6 +34,9 @@ openerp.pad = function(instance) { renderElement: function(){ var self = this; var value = this.get('value'); + if (this.pad_loading_request) { + this.pad_loading_request.abort(); + } if(!_.str.startsWith(value,'http')){ this.configured = false; this.content = ""; @@ -36,7 +46,8 @@ openerp.pad = function(instance) { this.content = '<iframe width="100%" height="100%" frameborder="0" src="'+value+'?showChat=false&userName='+this.session.username+'"></iframe>'; }else{ this.content = '<div class="oe_pad_loading">... Loading pad ...</div>'; - $.get(value+'/export/html').success(function(data){ + this.pad_loading_request = $.get(value+'/export/html') + .done(function(data){ groups = /\<\s*body\s*\>(.*?)\<\s*\/body\s*\>/.exec(data); data = (groups || []).length >= 2 ? groups[1] : ''; self.$('.oe_pad_content').html('<div class="oe_pad_readonly"><div>'); @@ -51,9 +62,6 @@ openerp.pad = function(instance) { this.$('.oe_pad_switch').click(function(){ self.$el.toggleClass('oe_pad_fullscreen'); }); - this.on('change:effective_readonly',this,function(){ - self.renderElement(); - }); }, }); |
