diff options
| author | Géry Debongnie <ged@odoo.com> | 2015-03-19 09:50:20 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2015-03-19 09:50:53 +0100 |
| commit | 21e38e3851fe9036743d9112d7597661e059214b (patch) | |
| tree | ca48fd10506fba243b3e96f5a981c27d760779a4 /addons/web/static/src/js/framework/misc.js | |
| parent | 882f1b3721569d0bf8002e00d6c29921bffa87c7 (diff) | |
[FIX] web: fix database manager
database manager is the only html file we have, and because of that,
regularly escapes the greps. It was still trying to load old files
before the javascript modules. It has now been updated to the new
file structure.
Also, I had to guard the nv customization from happening in misc.js
because the nvd3 library is not loaded in the database manager, but
the misc.js file is required. Not really happy about the misc.js file,
but this is for another commit.
Diffstat (limited to 'addons/web/static/src/js/framework/misc.js')
| -rw-r--r-- | addons/web/static/src/js/framework/misc.js | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/addons/web/static/src/js/framework/misc.js b/addons/web/static/src/js/framework/misc.js index 804a30cef7d..a24c64e5a66 100644 --- a/addons/web/static/src/js/framework/misc.js +++ b/addons/web/static/src/js/framework/misc.js @@ -206,31 +206,33 @@ core.action_registry.add("reload_context", ReloadContext); // nvd3 customization //------------------------------------------------------------------------- -nv.dev = false; // sets nvd3 library in production mode +if ('nv' in window) { + nv.dev = false; // sets nvd3 library in production mode -// monkey patch nvd3 to allow removing eventhandler on windowresize events -// see https://github.com/novus/nvd3/pull/396 for more details + // monkey patch nvd3 to allow removing eventhandler on windowresize events + // see https://github.com/novus/nvd3/pull/396 for more details -// Adds a resize listener to the window. -nv.utils.onWindowResize = function(fun) { - if (fun === null) return; - window.addEventListener('resize', fun); -}; + // Adds a resize listener to the window. + nv.utils.onWindowResize = function(fun) { + if (fun === null) return; + window.addEventListener('resize', fun); + }; -// Backwards compatibility with current API. -nv.utils.windowResize = nv.utils.onWindowResize; + // Backwards compatibility with current API. + nv.utils.windowResize = nv.utils.onWindowResize; -// Removes a resize listener from the window. -nv.utils.offWindowResize = function(fun) { - if (fun === null) return; - window.removeEventListener('resize', fun); -}; + // Removes a resize listener from the window. + nv.utils.offWindowResize = function(fun) { + if (fun === null) return; + window.removeEventListener('resize', fun); + }; -// monkey patch nvd3 to prevent crashes when user changes view and nvd3 tries -// to remove tooltips after 500 ms... seriously nvd3, what were you thinking? -nv.tooltip.cleanup = function () { - $('.nvtooltip').remove(); -}; + // monkey patch nvd3 to prevent crashes when user changes view and nvd3 tries + // to remove tooltips after 500 ms... seriously nvd3, what were you thinking? + nv.tooltip.cleanup = function () { + $('.nvtooltip').remove(); + }; +} // Bootstrap customization //------------------------------------------------------------------------- |
