mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-23 04:22:04 -06:00
[IMP] have titles work everywhere
This commit is contained in:
parent
faa04f7707
commit
0af4aea08c
@ -131,7 +131,7 @@ openerp.attachment_preview = function(instance)
|
|||||||
attachment_id,
|
attachment_id,
|
||||||
$target.siblings('a').attr('href'),
|
$target.siblings('a').attr('href'),
|
||||||
attachment_extension,
|
attachment_extension,
|
||||||
_t('Preview'));
|
$target.attr('alt'));
|
||||||
});
|
});
|
||||||
return (new instance.web.Model('ir.attachment')).call(
|
return (new instance.web.Model('ir.attachment')).call(
|
||||||
'get_binary_extension',
|
'get_binary_extension',
|
||||||
@ -173,10 +173,10 @@ openerp.attachment_preview = function(instance)
|
|||||||
{
|
{
|
||||||
var link = this._super.apply(this, arguments);
|
var link = this._super.apply(this, arguments);
|
||||||
link += _.template(
|
link += _.template(
|
||||||
'<img class="oe-binary-preview" alt="<%-preview_text%>" data-id="<%-preview_id%>" data-model="<%-preview_model%>" data-field="<%-preview_field%>" data-filename="<%-preview_filename%>" src="/web/static/src/img/icons/gtk-print-preview.png" />',
|
'<img class="oe-binary-preview" title="<%-preview_text%>" alt="<%-preview_text%>" data-id="<%-preview_id%>" data-model="<%-preview_model%>" data-field="<%-preview_field%>" data-filename="<%-preview_filename%>" src="/web/static/src/img/icons/gtk-print-preview.png" />',
|
||||||
{
|
{
|
||||||
preview_id: options.id,
|
preview_id: options.id,
|
||||||
preview_text: _t('Preview'),
|
preview_text: _.str.sprintf(_t('Preview %s'), this.string),
|
||||||
preview_model: options.model,
|
preview_model: options.model,
|
||||||
preview_field: this.id,
|
preview_field: this.id,
|
||||||
preview_filename: this.filename || '',
|
preview_filename: this.filename || '',
|
||||||
@ -218,8 +218,9 @@ openerp.attachment_preview = function(instance)
|
|||||||
self.name,
|
self.name,
|
||||||
self.view.datarecord.id),
|
self.view.datarecord.id),
|
||||||
extension,
|
extension,
|
||||||
self.view.datarecord[self.node.attrs.filename]);
|
_.str.sprintf(_t('Preview %s'), self.field.string));
|
||||||
});
|
});
|
||||||
|
$element.attr('title', _.str.sprintf(_t('Preview %s'), self.field.string));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -228,6 +229,10 @@ openerp.attachment_preview = function(instance)
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.$el.find('.oe-binary-preview').remove();
|
||||||
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user