{"id":18544501,"url":"https://github.com/instructure/ic-droppable","last_synced_at":"2025-04-09T19:30:45.710Z","repository":{"id":15684103,"uuid":"18421766","full_name":"instructure/ic-droppable","owner":"instructure","description":"Ember Component Mixin that wraps native drop events. No longer maintained.","archived":false,"fork":false,"pushed_at":"2016-02-27T00:04:12.000Z","size":1072,"stargazers_count":25,"open_issues_count":1,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-09T14:37:42.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instructure.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-03T23:40:50.000Z","updated_at":"2024-03-18T23:49:00.000Z","dependencies_parsed_at":"2022-09-11T02:10:36.427Z","dependency_job_id":null,"html_url":"https://github.com/instructure/ic-droppable","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/instructure%2Fic-droppable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fic-droppable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fic-droppable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fic-droppable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instructure","download_url":"https://codeload.github.com/instructure/ic-droppable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223407796,"owners_count":17140563,"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-06T20:16:43.376Z","updated_at":"2024-11-06T20:16:43.888Z","avatar_url":"https://github.com/instructure.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ic-droppable (no longer maintained)\n============\n\nEmber component mixin that wraps native drop events.\n\nDemo\n----\n\nhttps://instructure.github.io/ic-droppable\n\nInstallation\n------------\n\n`bower install ic-droppable`\n\n`npm install ic-droppable`\n\n... or download one of the distributions in `dist` and include however\nyou want.\n\nModule Support\n--------------\n\n- AMD\n\n  `define(['ic-droppable'], function(Droppable) {});`\n\n- CJS\n\n  `var Droppable = require('ic-styled')`\n\n- Globals\n\n  `var Droppable = ic.Droppable.default`\n\nUsage\n-----\n\n```js\nvar Droppable = ic.Droppable.default;\n\n// first mix Droppable into a component\nApp.XDropComponent = Ember.Component.extend(Droppable, {\n\n  tagName: 'x-drop',\n\n  // Next define a validateDragEvent method, native draggables have\n  // data types that you can read while the drag is moving over your\n  // component.\n\n  validateDragEvent: function(event) {\n    return event.dataTransfer.types.contains('text/x-drag');\n  },\n\n  // Finally, define an acceptDrop method to do whatever you need to\n  // do when the user drops on your component.\n\n  acceptDrop: function(event) {\n    var data = event.dataTransfer.getData('text/x-drag');\n    alert(data);\n  }\n});\n\n// And just for demonstration, here's a simple draggable element.\n\nApp.XDragComponent = Ember.Component.extend({\n  attributeBindings: ['draggable']\n  draggable: true,\n  setEventData: function(event) {\n    event.dataTransfer.setData('text/x-drag', this.get('elementId'));\n  }.on('dragStart')\n});\n```\n\n```css\n/*\n  when a valid drag event is over your component\n*/\n\nx-drop.accepts-drag {\n  background-color: green;\n}\n\n/*\n  when the component is dragging over itself, and it is a valid drop\n  target (the case with sortables sometimes)\n*/\n\nx-drop.self-drop {\n  background-color: red;\n}\n```\n\nAnd a simple template:\n\n```handlebars\n{{x-drag}}Drag me{{x-drag}}\n{{x-drop}}Drop here{{/x-drop}}\n```\n\nContributing\n------------\n\n```sh\nbower install\nnpm install\nnpm test\n```\n\nLicense and Copyright\n---------------------\n\nMIT Style license\n\n(c) 2014 Instructure, Inc.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fic-droppable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstructure%2Fic-droppable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fic-droppable/lists"}