material-design-for-bootstrap icon indicating copy to clipboard operation
material-design-for-bootstrap copied to clipboard

Chart.js style is injected into site header regardless of deleting the chart.js library

Open ni-fara opened this issue 4 years ago • 4 comments

After customizing MDB Free using Gulp and removing the line related to Chart.js component in \MDB Gulp Free\js\modules.js, mdb.js file still contains some code that injects the style below into site header.

<style type="text/css"> /* Chart.js */ @-webkit-keyframes chartjs-render-animation{from{opacity:0.99}to{opacity:1}}@keyframes chartjs-render-animation{from{opacity:0.99}to{opacity:1}}.chartjs-render-monitor{-webkit-animation:chartjs-render-animation 0.001s;animation:chartjs-render-animation 0.001s;} </style>

The function that injects the style is:

function injectCSS(platform, css) {
	// http://stackoverflow.com/q/3922139
	var style = platform._style || document.createElement('style');
	if (!platform._style) {
		platform._style = style;
		css = '/* Chart.js */\n' + css;
		style.setAttribute('type', 'text/css');
		document.getElementsByTagName('head')[0].appendChild(style);
	}

	style.appendChild(document.createTextNode(css));
}

ni-fara avatar Apr 03 '20 12:04 ni-fara

can anyone descrbe what's the issue?

ashish-hacker avatar Apr 07 '20 04:04 ashish-hacker

Hi. Try run 3 commands: npm run js-compile-plugins, npm run js-build' and npm run js-minify`. And check again. This should compile js again and delete chart.js code from mdb.js.

gbujanski avatar Apr 09 '20 08:04 gbujanski

Hi. Try run 3 commands: npm run js-compile-plugins, npm run js-build' and npm run js-minify`. And check again. This should compile js again and delete chart.js code from mdb.js.

Thanks @gbujanski , the extra code is deleted. But actually after deleting the line related to Chart.js in \MDB Gulp Free\js\modules.js and saving the file, the MDBootstrap gulp package automatically compiles new mdb.js and mdb.js.css files and deletes main chart.js code from them. Shouldn't it delete that extra code too?

ni-fara avatar Apr 15 '20 13:04 ni-fara

Hi @ni-fara ,

I'll create a task with this case and our team will check it and give you response.

Best,

mateuszlubianka1993 avatar Apr 16 '20 08:04 mateuszlubianka1993