Last active
December 28, 2015 10:09
-
-
Save mrvdb/7484003 to your computer and use it in GitHub Desktop.
change document title for openerp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple usecase here is I want to override the document title function from chrome.js | |
// Make sure the code is loaded, i.e. set to module name | |
openerp.profile_hsd = function(instance) { | |
// Override the set_title method to our own to have recognizable document titles | |
// FIXME: this comes *after* it has already been set to OpenERP earlier, perhaps no biggie | |
instance.web.WebClient.include({ | |
set_title: function(title) { | |
title = _.str.clean(title); | |
var sep = _.isEmpty(title) ? '' : ' - '; | |
document.title = title + sep + 'HSD'; | |
}, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful :) Thanks