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

Gets confused by comments #24

Open
robinzimmermann opened this issue Dec 17, 2014 · 3 comments
Open

Gets confused by comments #24

robinzimmermann opened this issue Dec 17, 2014 · 3 comments

Comments

@robinzimmermann
Copy link

Comments in the JavaScript code seem to cause confusion.

If I take this code:

var handleProtocolClick = function(event) {
protocol = getProtocolFromId(event.target.id);
var index = $.inArray(protocol, state.protocols);
if (index > -1) {
// If present it, remove it.
state.protocols.splice(index, 1);
} else {
state.protocols.push(protocol);
}
};

and beautify it, I get this:

var handleProtocolClick = function(event) {
    protocol = getProtocolFromId(event.target.id);
    var index = $.inArray(protocol, state.protocols);
    if (index > -1) {
// If present it, remove it.
state.protocols.splice(index, 1);
} else {
    state.protocols.push(protocol);
}
};

But if I remove the comment, it works:

var handleProtocolClick = function(event) {
    protocol = getProtocolFromId(event.target.id);
    var index = $.inArray(protocol, state.protocols);
    if (index > -1) {
        state.protocols.splice(index, 1);
    } else {
        state.protocols.push(protocol);
    }
};
@bwiggs
Copy link

bwiggs commented Mar 13, 2015

+1

@hiepnhl
Copy link

hiepnhl commented Mar 31, 2015

exx

I tried your code and it work perfectly :D. There's no confused :D

@amritk
Copy link

amritk commented Jun 9, 2015

+1

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