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

Updated paper-switch component #293

Conversation

jorgelainfiesta
Copy link
Contributor

Hi,

I'm opening this so you can start reviewing my changes. This is my first PR so I'd like to know if it's fine. I need help to test the Hammer.js behaviors on this component. I made some research on how to mock the gestures but still don't know what's the correct approach for the project.

Thanks,
Jorge L

@@ -84,12 +92,13 @@ export default BaseFocusable.extend(RippleMixin, ProxiableMixin, ColorMixin, {
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using jquery's css() and removeAttr() functions on .md-thumb-container, let's use a computed property that returns the style and bind it to the style attribute on the element like

<div class="md-thumb-container" style={{thumbContainerStyle}}>
  <!-- inner elements -->
</div>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you do that, you have to return a SafeString from the computed and use triple curlies.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miguelcobain miguelcobain added this to the 1.0 milestone Feb 22, 2016
@jorgelainfiesta
Copy link
Contributor Author

Thanks for the comments Miguel! I've done most of them, but I'm now dealing with issues that the changes created.

I was honestly lost in your conversation with Chris (runinspired) so I don't know what to do with Hamme now.

@jorgelainfiesta
Copy link
Contributor Author

I made the changes but now the sliding is really unstable. Not sure of what's causing it. The tests pass because they don't test Hammer gestures.

@miguelcobain
Copy link
Collaborator

I'm stocked that jscs tests are passing here. You shouldn't be able to write const in functions.

@jorgelainfiesta
Copy link
Contributor Author

I didn't know that. I actually rarely use let because most of the time I won't ever change the variable value.

@miguelcobain
Copy link
Collaborator

JSCS tests are failing because of: https://github.com/DockYard/ember-suave/issues/106#issuecomment-187720996

If JSCS tests were working you could not use const inside functions. Reasoning: http://madhatted.com/2016/1/25/let-it-be

Besides this, there are other style errors in this PR.
Too bad JSCS isn't working right now. :/

@jorgelainfiesta
Copy link
Contributor Author

Thanks for the info. I'll definitely change it today.

@miguelcobain
Copy link
Collaborator

Please run jscs -c .jscsrc addon to see your jscs errors (after npm install -g jscs).
You might see other errors related with other files. Ignore them please for now.

@jorgelainfiesta
Copy link
Contributor Author

I tried pulling wip/v1.0.0 and rebasing my branch to resolve conflicts but git says I'm up to date.

@jorgelainfiesta
Copy link
Contributor Author

Hi @miguelcobain, have you guys decided how we'd handle the hammer stuff? or should I try another component?

@miguelcobain
Copy link
Collaborator

@jorgelainfiesta

  1. you need to rebase your branch to reapply upstream commits to make this mergeable again
  2. Let's use vanilla HammerJS for now. We can switch to an ember addon later when things are more clear.

HammerJS recognizes gestures. We use it to recognize the pan action to move the switch.
Notice that the original angular material code binds the gestures in different components than this branch.

@miguelcobain miguelcobain merged commit 92d0172 into adopted-ember-addons:wip/v1.0.0 Mar 10, 2016
@miguelcobain
Copy link
Collaborator

I've finished the above stuff. Thanks.

@jorgelainfiesta
Copy link
Contributor Author

Sorry, thanks for fixing it. I totally messed up my repo trying to do the rebase, so I'd get some help from a friend by tomorrow. I'm glad it's merged now.

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

Successfully merging this pull request may close these issues.

3 participants