From a2c67409e8e31096303eb7643719c16a6f6d5a57 Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Wed, 2 Nov 2016 18:19:56 +0100 Subject: [PATCH] Documentation about drag and drop --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 7042191..f081988 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,37 @@ The following events are available: * `tab.on("unflash", (tab) => { ... });` * `tab.on("close", (tab) => { ... });` +## Drag and drop support + +Electron-tabs is compatible with [Dragula](https://github.com/bevacqua/dragula) so you can easily make your tabs draggable. + +Install Dragula: + +``` +npm install dragula --save +``` + +Don't forget to add a link to its stylesheet in the header: + +```html + +``` + +Then call Dragula in your script once tabGroup is ready: + +```javascript +const TabGroup = require("electron-tabs"); +const dragula = require("dragula"); + +var tabGroup = new TabGroup({ + ready: function (tabGroup) { + dragula([tabGroup.tabContainer], { + direction: "horizontal" + }); + } +}); +``` + ## License The MIT License (MIT) - Copyright (c) 2016 Thomas Brouard