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

The minimized js file does not work. #27

Open
JoseLobo1971 opened this issue Nov 24, 2023 · 1 comment
Open

The minimized js file does not work. #27

JoseLobo1971 opened this issue Nov 24, 2023 · 1 comment

Comments

@JoseLobo1971
Copy link

Installed product versions

  • Visual Studio: [example 2022 Professional]
  • This extension: [example 1.1.21]

Description

The minimized js file does not work because I think the process changes the original name of variables

Steps to recreate

Original js code:

div.ondrop = function (e) {
e.preventDefault();
var oGrd = BetterComponentsManager.GetComponent("datGridView_grdView");
if (oGrd != null) {
oGrd.GridViewBackGroundLayout(true);
if (oGrd.OnClientDrandAndDrop.indexOf("javascript") != -1) eval(oGrd.OnClientDrandAndDrop);
else eval(oGrd.OnClientDrandAndDrop + "(oGrd, e);");
}
}

Ofater executeing de blunder to minify de js file, this code example does not work , i think because the last eval( code written, loses the reference to the oGrd variable

Current behavior

r.ondrop=function(n){n.preventDefault();var t=BetterComponentsManager.GetComponent("datGridView_grdView");t!=null&&(t.GridViewBackGroundLayout(!0),t.OnClientDrandAndDrop.indexOf("javascript")!=-1?eval(t.OnClientDrandAndDrop):eval(t.OnClientDrandAndDrop+"(oGrd, e);"))}

Expected behavior

r.ondrop=function(e){e.preventDefault();var oGrd=BetterComponentsManager.GetComponent("datGridView_grdView");oGrd!=null&&(oGrd.GridViewBackGroundLayout(!0),oGrd.OnClientDrandAndDrop.indexOf("javascript")!=-1?eval(oGrd.OnClientDrandAndDrop):eval(oGrd.OnClientDrandAndDrop+"(oGrd, e);"))}

@failwyn
Copy link
Owner

failwyn commented Dec 8, 2023

What is the error message you are getting? It looks like it correctly minimized all of your references to oGrid with t.

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

2 participants