{"action":"closed","issue":{"url":"https://api.github.com/repos/google/web-starter-kit/issues/499","labels_url":"https://api.github.com/repos/google/web-starter-kit/issues/499/labels{/name}","comments_url":"https://api.github.com/repos/google/web-starter-kit/issues/499/comments","events_url":"https://api.github.com/repos/google/web-starter-kit/issues/499/events","html_url":"https://github.com/google/web-starter-kit/issues/499","id":46629697,"number":499,"title":"Material-Sprint: app/styleguide/button","user":{"login":"jasonmayes","id":4972997,"avatar_url":"https://avatars.githubusercontent.com/u/4972997?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonmayes","html_url":"https://github.com/jasonmayes","followers_url":"https://api.github.com/users/jasonmayes/followers","following_url":"https://api.github.com/users/jasonmayes/following{/other_user}","gists_url":"https://api.github.com/users/jasonmayes/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmayes/subscriptions","organizations_url":"https://api.github.com/users/jasonmayes/orgs","repos_url":"https://api.github.com/users/jasonmayes/repos","events_url":"https://api.github.com/users/jasonmayes/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmayes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/web-starter-kit/labels/code-style","name":"code-style","color":"006b75"},{"url":"https://api.github.com/repos/google/web-starter-kit/labels/P1","name":"P1","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/google/web-starter-kit/milestones/3","labels_url":"https://api.github.com/repos/google/web-starter-kit/milestones/3/labels","id":827637,"number":3,"title":"0.6.0","description":"Material Design for the web.","creator":{"login":"addyosmani","id":110953,"avatar_url":"https://avatars.githubusercontent.com/u/110953?v=3","gravatar_id":"","url":"https://api.github.com/users/addyosmani","html_url":"https://github.com/addyosmani","followers_url":"https://api.github.com/users/addyosmani/followers","following_url":"https://api.github.com/users/addyosmani/following{/other_user}","gists_url":"https://api.github.com/users/addyosmani/gists{/gist_id}","starred_url":"https://api.github.com/users/addyosmani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addyosmani/subscriptions","organizations_url":"https://api.github.com/users/addyosmani/orgs","repos_url":"https://api.github.com/users/addyosmani/repos","events_url":"https://api.github.com/users/addyosmani/events{/privacy}","received_events_url":"https://api.github.com/users/addyosmani/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":18,"state":"open","created_at":"2014-10-15T16:51:01Z","updated_at":"2015-01-05T15:04:14Z","due_on":"2014-12-15T00:00:00Z","closed_at":null},"comments":1,"created_at":"2014-10-23T14:18:16Z","updated_at":"2015-01-05T15:04:14Z","closed_at":"2015-01-05T15:04:14Z","body":"### demo.html\r\n\r\n* Much whitespace when not needed eg https://github.com/google/web-starter-kit/blob/material-sprint/app/styleguide/button/demo.html#L9 this can be tidied up\r\n\r\n\r\n### button.js\r\n\r\n* For readability lets use more meaningful variable names. For example on line 3 constructor we have el, we should call this element to be clearer. Same in other parts of file eg line 26 and 90 etc..\r\n\r\n* Move functions to prototype (lines 22 - 87) https://github.com/google/web-starter-kit/blob/material-sprint/app/styleguide/button/button.js#L22 After discussing this with Addy, conclusion is that it was better to favor memory savings.  This means private variable declarations that need to be used in a prototyped function would need to be converted from var x to be this.x  so it can be accessed. We should therefore use the common convention of adding an underscore on the end to indicate it is private and shouldnt be used directly. So the variable would be defined as: this.x_ = blah;\r\n\r\n* Initialize declared variables with a default. Eg https://github.com/google/web-starter-kit/blob/material-sprint/app/styleguide/button/button.js#L8 same elsewhere. Will allow you to loose part of a conditional later on - easier to read. Eg if scale and size were initialized on lines 42 and 43, the conditional directly proceeding would not need the else statement and only overwrites if start is true. Line 53 is then also redundant as it could have been initialized above in one line. Etc...\r\n\r\n* Remove unneeded whitespace where it makes sense eg on line 15 https://github.com/google/web-starter-kit/blob/material-sprint/app/styleguide/button/button.js#L15\r\n\r\n* To make this IE9 friendly use an alternative to classlist.add and classlist.remove on 73 and 76. We should really try and get IE9 support if possible.\r\n\r\n* What happens when paper buttons are added to the dom via javascript AFTER the document load has already fired? Handle this case as it is quite possible someone will need to programatically add a button.\r\n\r\n* Put all classes and constants in their own respective private enum objects near top of file so they can easily be changed in 1 place going forwards. For example:\r\n\r\n```JAVASCRIPT\r\nthis.ClassNames_ = {\r\n  TRANSITION_LONG: 'transitionLong',\r\n  UNSCALED: 'unscaled',\r\n  SCALED: 'scaled'\r\n};\r\n```\r\n"}}