summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js
diff options
context:
space:
mode:
authorddm <ddm@openerp.com>2013-09-11 17:45:02 +0200
committerddm <ddm@openerp.com>2013-09-11 17:45:02 +0200
commit1bcae6b62fed65ea5b2797533e3a8bac41760dcb (patch)
tree7443bd4e12f212e9a266e053a4e8131326f9ef2b /addons/website/static/src/js
parent79cc608e57c1e8b686589ea1c9470a1a1344a17b (diff)
[IMP] CSS transparency support
bzr revid: ddm@openerp.com-20130911154502-r2493m71f2x8vvdl
Diffstat (limited to 'addons/website/static/src/js')
-rw-r--r--addons/website/static/src/js/website.ace.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js
index 89ab84db493..77d0e30dd70 100644
--- a/addons/website/static/src/js/website.ace.js
+++ b/addons/website/static/src/js/website.ace.js
@@ -1,6 +1,8 @@
(function () {
'use strict';
+ var globalEditor;
+
var website = openerp.website;
website.templates.push('/website/static/src/xml/website.ace.xml');
@@ -9,7 +11,12 @@
'click a[data-action=ace]': 'launchAce',
}),
launchAce: function () {
- new website.ace.ViewEditor(this).appendTo($(document.body));
+ if (globalEditor) {
+ globalEditor.open();
+ } else {
+ globalEditor = new website.ace.ViewEditor(this);
+ globalEditor.appendTo($(document.body));
+ }
},
});
@@ -63,10 +70,11 @@
var viewId = $(document.documentElement).data('view-xmlid');
openerp.jsonRpc('/website/customize_template_get', 'call', {
'xml_id': viewId,
- 'optional': false
+ 'optional': false,
}).then(function (views) {
self.loadViewList.call(self, views);
});
+ this.$el.hover();
},
selectedViewId: function () {
return this.$('#ace-view-list').val();
@@ -91,7 +99,7 @@
openerp.jsonRpc('/web/dataset/call', 'call', {
model: 'ir.ui.view',
method: 'read',
- args: [[this.selectedViewId()], ['arch']]
+ args: [[this.selectedViewId()], ['arch']],
}).then(function(result) {
if (result && result.length > 0) {
var xml = new website.ace.XmlDocument(result[0].arch)
@@ -115,7 +123,7 @@
openerp.jsonRpc('/web/dataset/call', 'call', {
model: 'ir.ui.view',
method: 'write',
- args: [[this.selectedViewId()], { 'arch': xml.xml }]
+ args: [[this.selectedViewId()], { 'arch': xml.xml }],
}).then(function(result) {
self.reloadPage();
}).fail(function (error) {
@@ -134,16 +142,13 @@
alert("Malformed XML document");
},
open: function () {
- var $close = this.$('.pull-right');
- this.$el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
- $close.fadeIn(200);
- }).removeClass('oe_ace_closed').addClass('oe_ace_open');
+ this.$el.removeClass('oe_ace_closed').addClass('oe_ace_open');
this.displayView();
},
close: function () {
var self = this;
- this.$('.pull-right').fadeOut(100);
this.$el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
+ globalEditor = null;
self.destroy.call(self);
}).removeClass('oe_ace_open').addClass('oe_ace_closed');
},