You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 11, 2021. It is now read-only.
Summary:
The functions in utils/graphie-drawing.js (which I think are just used by
graphie-to-png users) take an `options` object which includes style properties
and non-style properties all jumbled together.
The `getStyles()` function promises to extract the style properties, but
doesn't actually filter out only style properties.
This leads to a weird side-effect. If you pass a property value that is a
function to `$.css()`, the function will get called and the return value will
be applied as the property value.
This fixes `getStyles()` to only include style properties that are actually
style properties. It's possible I missed some, but I think I got all the ones
we use. Good news is this is only used by graphie-to-png users, so the risk of
breaking something on the live site is pretty much nil.
Test Plan:
1. Run ./app.py
2. http://localhost:5001/
3. Enter this:
```
init({range: [[-10, 10], [-10, 10]], scale: 20});
var i = 0;
drawPolygon({
whyIsThisCalled: function() {
i += 1;
}
});
console.log("Was called " + i + " times");
```
4. Regraph and see "Was called 0 times" in the console.
5. Load and graph templates #13, #17, #18, #19, and #20 and verify they look the same.
Reviewers: emily, alex
Reviewed By: alex
Subscribers: aria, kevinb
Differential Revision: https://phabricator.khanacademy.org/D16505
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Not sure why, it's a mystery! Example:
http://gyazo.com/6f4595c1986976070341c4b3554b1ea5.png
The text was updated successfully, but these errors were encountered: