[IMP] make spans editable (though not RTE, not supported) & use t-record for company name

bzr revid: xmo@openerp.com-20130726113742-ix2f4tyy0xvoy9lq
This commit is contained in:
Xavier Morel 2013-07-26 13:37:42 +02:00
parent 7d59a7355f
commit 5176607c2a
2 changed files with 8 additions and 4 deletions

View File

@ -38,7 +38,12 @@ instance.website.EditorBar = instance.web.Widget.extend({
edit: function () {
this.$buttons.edit.prop('disabled', true);
this.$buttons.cancel.prop('disabled', false);
this.rte.start_edition($('[data-oe-model]').addClass('oe_editable'));
// TODO: span edition changing edition state (save button)
this.rte.start_edition(
$('[data-oe-model]')
.not('link, script')
.prop('contentEditable', true)
.addClass('oe_editable'));
},
rte_changed: function () {
this.$buttons.save.prop('disabled', false);
@ -138,8 +143,7 @@ instance.website.RTE = instance.web.Widget.extend({
start_edition: function ($elements) {
var self = this;
$elements
.not('link, script, span')
.prop('contentEditable', true)
.not('span')
.each(function () {
var $this = $(this);
CKEDITOR.inline(this, self._config()).on('change', function () {

View File

@ -37,7 +37,7 @@
</ul>
</div>
<div class="span4" name="about_us">
<h5 t-esc="res_company.name">Company name</h5>
<h5 t-record="res_company" t-field="name">Company name</h5>
<ul>
<li><a href="/page/website.contactus">Contact us</a></li>
<li><a href="/page/website.news">News</a></li>