{"id":20461049,"url":"https://github.com/ericgj/drawer","last_synced_at":"2025-10-30T04:22:33.417Z","repository":{"id":22506666,"uuid":"25846823","full_name":"ericgj/drawer","owner":"ericgj","description":"Drawer UI component","archived":false,"fork":false,"pushed_at":"2014-11-19T16:36:29.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T00:35:40.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericgj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-28T01:04:24.000Z","updated_at":"2014-11-19T16:36:29.000Z","dependencies_parsed_at":"2022-08-21T07:00:22.460Z","dependency_job_id":null,"html_url":"https://github.com/ericgj/drawer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fdrawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fdrawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fdrawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fdrawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgj","download_url":"https://codeload.github.com/ericgj/drawer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242017456,"owners_count":20058432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T12:23:01.494Z","updated_at":"2025-10-30T04:22:28.391Z","avatar_url":"https://github.com/ericgj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# drawer\n\n  Drawer UI component\n\n## Installation\n\n  Install with [component(1)](http://component.io):\n\n    $ component install ericgj/drawer\n\n\u003ca name=\"example\"\u003e\u003c/a\u003e\n## Example\n\n```js\nvar Drawer = require('drawer');\nvar drawer = Drawer();\ndrawer.close();   // init state\ndrawer(sidebar);  // first render\n\ntoggleButton.addEventListener('click', drawer.toggle);\nopenButton.addEventListener('click', drawer.open);\ncloseButton.addEventListener('click', drawer.close);\n\n```\n\n\u003ca name=\"api\"\u003e\u003c/a\u003e\n## API\n\n  \u003ca name=\"api_constructor\"\u003e#\u003c/a\u003e\u003cbr/\u003e\n  var Drawer = require('drawer')\u003cbr/\u003e\n  var drawer = \u003cb\u003eDrawer()\u003c/b\u003e\n\n  Construct a new drawer _render function_.\n\n  \u003ca name=\"api_render\"\u003e#\u003c/a\u003e\n  \u003cb\u003edrawer\u003c/b\u003e(\u003ci\u003eel\u003c/i\u003e)\n\n  Apply the drawer to the given element. The given element should be your \n  'sidebar' container.\n\n  \u003ca name=\"api_toggle\"\u003e#\u003c/a\u003e\n  drawer.\u003cb\u003etoggle\u003c/b\u003e()\n\n  Toggle the drawer open or closed.\n\n  \u003ca name=\"api_open\"\u003e#\u003c/a\u003e\n  drawer.\u003cb\u003eopen\u003c/b\u003e()\n\n  Programmatically open the drawer (if not already opened).\n\n  \u003ca name=\"api_close\"\u003e#\u003c/a\u003e\n  drawer.\u003cb\u003eclose\u003c/b\u003e()\n\n  Programmatically close the drawer (if not already closed).\n\n  \u003ca name=\"api_parent\"\u003e#\u003c/a\u003e\n  drawer.\u003cb\u003eparent\u003c/b\u003e(\u003ci\u003eel\u003c/i\u003e)\n\n  Set the parent element (i.e., the element that will get left-padded over when\n  the drawer is opened.) If not specified, it is the parent node of the rendered\n  element in the DOM. Generally, this should be set before rendering.\n\n\u003ca name=\"api_events\"\u003e\u003c/a\u003e\n### Events\n\n  \u003ca name=\"api_events_toggle\"\u003e#\u003c/a\u003e\n  drawer.on('\u003cb\u003etoggle\u003c/b\u003e', \u003ci\u003ehandler\u003c/i\u003e)\n\n  Fired on any drawer state change. Handler is called with the new state\n  (`true` if open, `false` if closed).\n\n  \u003ca name=\"api_events_open\"\u003e#\u003c/a\u003e\n  drawer.on('\u003cb\u003eopen\u003c/b\u003e', \u003ci\u003ehandler\u003c/i\u003e)\n\n  Fired after the drawer has been opened.\n\n  \u003ca name=\"api_events_close\"\u003e#\u003c/a\u003e\n  drawer.on('\u003cb\u003eclose\u003c/b\u003e', \u003ci\u003ehandler\u003c/i\u003e)\n\n  Fired after the drawer has been closed.\n\n  \u003ca name=\"api_events_before\"\u003e#\u003c/a\u003e\u003cbr/\u003e\n  drawer.on('\u003cb\u003etoggling\u003c/b\u003e', \u003ci\u003ehandler\u003c/i\u003e)\u003cbr/\u003e\n  drawer.on('\u003cb\u003eopening\u003c/b\u003e', \u003ci\u003ehandler\u003c/i\u003e)\u003cbr/\u003e\n  drawer.on('\u003cb\u003eclosing\u003c/b\u003e', \u003ci\u003ehandler\u003c/i\u003e)\n\n  Fired before drawer toggle, open, and close, respectively.\n\n\n## License\n\n  The MIT License (MIT)\n\n  Copyright (c) 2014 Eric Gjertsen \u003cericgj72@gmail.com\u003e\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Fdrawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgj%2Fdrawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Fdrawer/lists"}