Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ni-fara opened this issue Apr 3, 2020 · 4 comments

Comments

@ni-fara
Copy link

ni-fara commented Apr 3, 2020

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 ni-fara changed the title Chart.js style is injected regardless of deleting the chart.js library Chart.js style is injected into site header regardless of deleting the chart.js library Apr 3, 2020
@ashish-hacker
Copy link

can anyone descrbe what's the issue?

@gbujanski
Copy link
Member

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.

@ni-fara
Copy link
Author

ni-fara commented Apr 15, 2020

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?

@mateuszlubianka1993
Copy link
Contributor

Hi @ni-fara ,

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

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants