mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-22 13:22:19 -06:00
[UPD] use viewerjs 0.5.7
This commit is contained in:
@@ -21,20 +21,13 @@
|
||||
|
||||
// This file contains tweaks for viewerjs itself and is not meant to be run in
|
||||
// OpenERP's context
|
||||
var original_loadDocument = loadDocument;
|
||||
loadDocument = function(documentUrl)
|
||||
var original_Viewer = Viewer;
|
||||
Viewer = function(plugin, parameters)
|
||||
{
|
||||
original_loadDocument.apply(this, arguments);
|
||||
var original_onload = window.onload;
|
||||
window.onload = function()
|
||||
var matches = (/&title=([^&]+)&/).exec(window.location.hash);
|
||||
if(matches && matches.length > 1)
|
||||
{
|
||||
original_onload();
|
||||
var matches = (/&title=([^&]+)&/).exec(window.location.hash);
|
||||
if(matches && matches.length > 1)
|
||||
{
|
||||
document.title = decodeURIComponent(matches[1]);
|
||||
document.getElementById('documentName').innerHTML = document.title;
|
||||
|
||||
}
|
||||
};
|
||||
parameters.title = decodeURIComponent(matches[1]);
|
||||
}
|
||||
return original_Viewer(plugin, parameters);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user