[REV] base.xml changes of xmo@openerp.com-20110908125510-fb7vcjsixj5sqhpz: new version was simpler, it was also completely broken
issue here is that <tr> element bears a foreach, which we have to keep, so can't just insert new tds in the row (they'll get repeated), we can't remove the tr (not without grafting the old attributes), etc... it's really kind-of a pain. Basically, the replaceAll() is used to make the <t> just created replace the <tr> matched, the unwrapAll removes the <table> around it all, resulting in a <t> with the buttons inserted before and after it, all landed in the editable-listview-generated-row bzr revid: xmo@openerp.com-20110909134244-mbf5sf4to09fvsyi
This commit is contained in:
parent
28f900202b
commit
bd92c1282b
|
@ -1211,11 +1211,21 @@
|
|||
<button type="button" class="oe_formopenpopup-form-close">Cancel</button>
|
||||
</t>
|
||||
<t t-name="ListView.row.frame" t-extend="WidgetFrame">
|
||||
<t t-jquery="tr" t-operation="prepend">
|
||||
<td><button type="button" class="oe-edit-row-cancel">Cancel</button></td>
|
||||
</t>
|
||||
<t t-jquery="tr" t-operation="append">
|
||||
<td><button type="button" class="oe-edit-row-save">Save</button></td>
|
||||
<t t-jquery="tr">
|
||||
$(document.createElement('t'))
|
||||
.append(this.contents())
|
||||
.attr({
|
||||
't-foreach': this.attr('t-foreach'),
|
||||
't-as': this.attr('t-as')
|
||||
})
|
||||
.replaceAll(this)
|
||||
.after($(document.createElement('td')).append(
|
||||
$(document.createElement('button')).attr({
|
||||
'class': 'oe-edit-row-save', 'type': 'button'}).text('Save')))
|
||||
.before($(document.createElement('td')).append(
|
||||
$(document.createElement('button')).attr({
|
||||
'class': 'oe-edit-row-cancel', 'type': 'button'}).text('Cancel')))
|
||||
.unwrap();
|
||||
</t>
|
||||
</t>
|
||||
|
||||
|
|
Loading…
Reference in New Issue