{"action":"created","issue":{"url":"https://api.github.com/repos/cshold/Timber/issues/2","labels_url":"https://api.github.com/repos/cshold/Timber/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/cshold/Timber/issues/2/comments","events_url":"https://api.github.com/repos/cshold/Timber/issues/2/events","html_url":"https://github.com/cshold/Timber/pull/2","id":57509287,"number":2,"title":"New Mobile Nav and Cart Drawers","user":{"login":"cshold","id":1730309,"avatar_url":"https://avatars.githubusercontent.com/u/1730309?v=3","gravatar_id":"","url":"https://api.github.com/users/cshold","html_url":"https://github.com/cshold","followers_url":"https://api.github.com/users/cshold/followers","following_url":"https://api.github.com/users/cshold/following{/other_user}","gists_url":"https://api.github.com/users/cshold/gists{/gist_id}","starred_url":"https://api.github.com/users/cshold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cshold/subscriptions","organizations_url":"https://api.github.com/users/cshold/orgs","repos_url":"https://api.github.com/users/cshold/repos","events_url":"https://api.github.com/users/cshold/events{/privacy}","received_events_url":"https://api.github.com/users/cshold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T19:43:36Z","updated_at":"2015-02-25T00:06:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cshold/Timber/pulls/2","html_url":"https://github.com/cshold/Timber/pull/2","diff_url":"https://github.com/cshold/Timber/pull/2.diff","patch_url":"https://github.com/cshold/Timber/pull/2.patch"},"body":"Demo - http://carson-blank.myshopify.com/\r\n\r\n##### Drawer stuff:\r\n- Minimized replaceUrlParam function, added [prepareTransition](https://github.com/snookca/prepareTransition)\r\n- `timber.drawersInit` sets up multiple drawers (in this case menu and cart)\r\n- use `Drawers` module from Shopify's [Marketing Assets](https://github.com/Shopify/marketing_assets/blob/f6c830aff2809eabf64d72a0ca3ece345f32aac5/app/assets/javascripts/marketing_assets/modules/drawers.js)\r\n  - JS slightly trimmed down because of the original module using other asset properties/variables\r\n  - Minor changes for `evt` handling since the drawers can also be opened by a call to `timber.RightDrawer.open();` (used after a product is added to the cart)\r\n  - Pulled in the CSS and animations from there too\r\n\r\n##### Non drawer stuff:\r\n- Base button style\r\n- Added transform mixin\r\n- Moved search bar into header above navigation\r\n- Standardized some icon font weights and sizes\r\n\r\nIgnore the markup changes in `theme.liquid` for now. It will likely change a few more times when the cart ajax cart is introduced.\r\n\r\n*Note*: This PR was rebased from Timber master. The PR for the merge will be less drastic."},"comment":{"url":"https://api.github.com/repos/cshold/Timber/issues/comments/75878876","html_url":"https://github.com/cshold/Timber/pull/2#issuecomment-75878876","issue_url":"https://api.github.com/repos/cshold/Timber/issues/2","id":75878876,"user":{"login":"carolineschnapp","id":143817,"avatar_url":"https://avatars.githubusercontent.com/u/143817?v=3","gravatar_id":"","url":"https://api.github.com/users/carolineschnapp","html_url":"https://github.com/carolineschnapp","followers_url":"https://api.github.com/users/carolineschnapp/followers","following_url":"https://api.github.com/users/carolineschnapp/following{/other_user}","gists_url":"https://api.github.com/users/carolineschnapp/gists{/gist_id}","starred_url":"https://api.github.com/users/carolineschnapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carolineschnapp/subscriptions","organizations_url":"https://api.github.com/users/carolineschnapp/orgs","repos_url":"https://api.github.com/users/carolineschnapp/repos","events_url":"https://api.github.com/users/carolineschnapp/events{/privacy}","received_events_url":"https://api.github.com/users/carolineschnapp/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T00:06:46Z","updated_at":"2015-02-25T00:06:46Z","body":"Thanks Carson!\r\n\r\nIt was not working because I was trying to make that work outside of the Timber framework, and worked at it poorly. I gave up on this, and that's fine. Like you said, it is not a plugin. It's a framework module.\r\n\r\nI have a few remarks on the new afterCartLoad implementation.\r\n\r\nSo, any app or JavaScript solution (such as multiple currencies) that wants to do something after the cart drawer is loaded, without requiring a merchant to edit existing code in the theme, will need to do this:\r\n\r\n```javascript\r\nif (typeof afterCartLoad === 'undefined') {\r\n  var afterCartLoad = function(data) {\r\n    /* Do something */\r\n  }\r\n}\r\nelse {\r\n  var original_afterCartLoad = window.afterCartLoad;\r\n  var afterCartLoad = function(data) {\r\n    original_afterCartLoad(data);\r\n    /* Do something */\r\n  };\r\n}\r\n```\r\n\r\nHow about custom events?\r\nhttp://css-tricks.com/custom-events-are-pretty-cool/"}}