Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Conversation

devversion
Copy link
Member

This fixes the complete switch drag functionality.
Fix ported from my previous work at material2 (https://github.com/angular/material2/pull/7/files)

Fixes #4719 Fixes #2338

@devversion devversion force-pushed the fix/switch-drag-functionality branch from f05cee5 to b8d8cfc Compare January 16, 2016 19:21
@@ -150,7 +150,7 @@ function MdCheckboxDirective(inputDirective, $mdAria, $mdConstant, $mdTheming, $
}
}
function listener(ev) {
if (element[0].hasAttribute('disabled')) {
if (element[0].hasAttribute('disabled') || scope.skipToggle) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@EladBezalel Should I add a comment here to explain what skipToggle is used for?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes plz

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@devversion devversion force-pushed the fix/switch-drag-functionality branch from b8d8cfc to 08ad0b2 Compare January 22, 2016 20:32
@EladBezalel EladBezalel added the needs: manual testing This issue or PR needs to have some manual testing and verification done label Jan 22, 2016
var checkbox = compileAndLink('<md-checkbox ng-model="blue"></md-checkbox>');
var scope = checkbox.scope();

scope.skipToggle = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would this be set to 'true' ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to test if the checkbox skips the click, this is needed for the switch. Bust just rethought, it would make more sense to add this to the switch tests, using the switch extending the checkbox.

@ThomasBurleson ThomasBurleson added needs: work in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Jan 30, 2016
@ThomasBurleson ThomasBurleson self-assigned this Jan 30, 2016
@ThomasBurleson ThomasBurleson added this to the 1.1.0 milestone Jan 30, 2016
This fixes the complete switch drag functionality.
Fix ported from my previous work at material2 (https://github.com/angular/material2/pull/7/files)

Fixes angular#4719 Fixes angular#2338
@devversion devversion force-pushed the fix/switch-drag-functionality branch from 08ad0b2 to 1036d6f Compare January 30, 2016 17:43
@devversion devversion removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs needs: work labels Feb 24, 2016
@ThomasBurleson ThomasBurleson added the needs: team discussion This issue requires a decision from the team before moving forward. label Feb 26, 2016
@devversion devversion added needs: review This PR is waiting on review from the team and removed needs: manual testing This issue or PR needs to have some manual testing and verification done needs: team discussion This issue requires a decision from the team before moving forward. labels Apr 19, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.1.2, 1.1.0 Apr 19, 2016
@ThomasBurleson ThomasBurleson added needs: work in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs and removed needs: review This PR is waiting on review from the team labels Apr 19, 2016
@devversion
Copy link
Member Author

@ThomasBurleson It's very hard for me to detect your reason.. What particular line or block needs work?

@ThomasBurleson
Copy link
Contributor

@devversion - your conversation with @EladBezalel indicates unresolved agreement on solution.

@devversion
Copy link
Member Author

@ThomasBurleson I agree, thx. @EladBezalel Can you respond to my last comment? You didn't answer yet.

@ThomasBurleson ThomasBurleson removed this from the 1.1.2 milestone Apr 21, 2016
@ThomasBurleson ThomasBurleson modified the milestones: Backlog, 1.1.2 Apr 21, 2016
@EladBezalel
Copy link
Member

@ThomasBurleson feels odd to me that we need to use $timeout but it seems that there's no other option, other than that lgtm

@EladBezalel EladBezalel added needs: review This PR is waiting on review from the team and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs needs: work labels Apr 21, 2016
@ThomasBurleson ThomasBurleson added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels Jun 4, 2016
@devversion devversion deleted the fix/switch-drag-functionality branch June 6, 2016 15:37
@Splaktar Splaktar removed this from the - Backlog milestone Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

md-switch bounces back when dragged mdSwitch click and drag
4 participants