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

Line breaks in Ext.NET.FieldTrigger.Handler() generates invalid JavaScript #1362

Open
fabriciomurta opened this issue Jul 26, 2016 · 1 comment

Comments

@fabriciomurta
Copy link
Contributor

The following example:

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>c61225_Index</title>
</head>
<body>
    <div> 
@{
    var x = Html.X();
}
        @x.ResourceManager()
@(
    x.TextField()
        .Triggers(
            x.FieldTrigger()
                .Icon(TriggerIcon.Ellipsis)
                .Handler(@"
                    alert('test');
                ")
        )
)
    </div>
</body>
</html>

Generates the following error in its JavaScript output:

triggers: {"_trigger1":{handler:function(){\n                    alert('test');\n                }...

The '\n' are output unescaped and outside strings. In fact they should be actual line breaks instead. Or nothing, if "minifying" the output.

@fabriciomurta
Copy link
Contributor Author

As a solution for this, the same @<text></text> mechanism installed in Ext.NET Mobile can be implemented here.

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

No branches or pull requests

1 participant