{"action":"created","issue":{"url":"https://api.github.com/repos/Famous/famous/issues/512","labels_url":"https://api.github.com/repos/Famous/famous/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/Famous/famous/issues/512/comments","events_url":"https://api.github.com/repos/Famous/famous/issues/512/events","html_url":"https://github.com/Famous/famous/pull/512","id":50646165,"number":512,"title":"[develop] Draggable - Fixes and new Threshold and Autocomplete options","user":{"login":"StephanBijzitter","id":1649903,"avatar_url":"https://avatars.githubusercontent.com/u/1649903?v=3","gravatar_id":"","url":"https://api.github.com/users/StephanBijzitter","html_url":"https://github.com/StephanBijzitter","followers_url":"https://api.github.com/users/StephanBijzitter/followers","following_url":"https://api.github.com/users/StephanBijzitter/following{/other_user}","gists_url":"https://api.github.com/users/StephanBijzitter/gists{/gist_id}","starred_url":"https://api.github.com/users/StephanBijzitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephanBijzitter/subscriptions","organizations_url":"https://api.github.com/users/StephanBijzitter/orgs","repos_url":"https://api.github.com/users/StephanBijzitter/repos","events_url":"https://api.github.com/users/StephanBijzitter/events{/privacy}","received_events_url":"https://api.github.com/users/StephanBijzitter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Famous/famous/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Famous/famous/labels/cla+signed","name":"cla signed","color":"009800"},{"url":"https://api.github.com/repos/Famous/famous/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/Famous/famous/labels/might+break+stuff","name":"might break stuff","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-12-02T12:39:33Z","updated_at":"2015-01-15T21:29:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Famous/famous/pulls/512","html_url":"https://github.com/Famous/famous/pull/512","diff_url":"https://github.com/Famous/famous/pull/512.diff","patch_url":"https://github.com/Famous/famous/pull/512.patch"},"body":"* Changed order of operation to patch options before trying to use them\r\n* Fixed default transition (wasn't being registered)\r\n* Added `options.threshold`\r\n* Added shorthand options\r\n* Added `options.autocomplete'\r\n* Fixed `options.projection` <-- MAY BREAK STUFF\r\n\r\nThreshold example:\r\n```javascript\r\nvar draggable = new Draggable({\r\n    xRange : [-200, 0],\r\n    yRange : [0, 0],\r\n    threshold : [50, 0],\r\n    transition : {\r\n        duration : 200\r\n    }\r\n});\r\n```\r\n\r\nWith shorthand options:\r\n```javascript\r\nvar draggable = new Draggable({\r\n    range : [[-200, 0], [0, 0]],\r\n    threshold : [50, 0],\r\n    transition : {\r\n        duration : 200\r\n    }\r\n});\r\n```\r\nThis is an example I use in my own app to drag out a menu from the right side of the screen.\r\n\r\nThe app essentially has a vertical scroller, to which the draggable is subscribed.\r\nThe scroller moves to the left when dragged, to reveal a menu underneath.\r\n\r\nHowever, without threshold any displacement along the x-axis, would result in dragging, even when the user's intention was to vertically scroll through the content. By setting the x-threshold to `50`, the user must explicitly drag 50 pixels to the left **or** right for the draggable to even start responding to the input.\r\n\r\nThe transition now makes sure that those 50 pixels are not an instant movement, but a gently flowing movement instead. **This transition also applies to the snapping of the draggable!**\r\n\r\nLive example:\r\nhttp://skelware.com/famo.us/draggable/example/1/\r\n* Doubleclick to transition between 'pages' (currently page a and page b alternate).\r\nThis is a lightbox and the pages are vertical scrollviews.\r\n\r\n* Drag left to open the menu\r\nYou need to drag at least 50 pixels\r\n\r\n* Drag right to close the menu\r\nYou do *not* need to drag at least 50 pixels"},"comment":{"url":"https://api.github.com/repos/Famous/famous/issues/comments/70165374","html_url":"https://github.com/Famous/famous/pull/512#issuecomment-70165374","issue_url":"https://api.github.com/repos/Famous/famous/issues/512","id":70165374,"user":{"login":"TheAlphaNerd","id":498775,"avatar_url":"https://avatars.githubusercontent.com/u/498775?v=3","gravatar_id":"","url":"https://api.github.com/users/TheAlphaNerd","html_url":"https://github.com/TheAlphaNerd","followers_url":"https://api.github.com/users/TheAlphaNerd/followers","following_url":"https://api.github.com/users/TheAlphaNerd/following{/other_user}","gists_url":"https://api.github.com/users/TheAlphaNerd/gists{/gist_id}","starred_url":"https://api.github.com/users/TheAlphaNerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheAlphaNerd/subscriptions","organizations_url":"https://api.github.com/users/TheAlphaNerd/orgs","repos_url":"https://api.github.com/users/TheAlphaNerd/repos","events_url":"https://api.github.com/users/TheAlphaNerd/events{/privacy}","received_events_url":"https://api.github.com/users/TheAlphaNerd/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T21:29:51Z","updated_at":"2015-01-15T21:29:51Z","body":"/cc @michaelobriena can this potentially land in 0.4?"}}