drag-and-drop

Precise Drag and Drop within a contenteditable

不想你离开。 提交于 2019-12-18 10:13:12
问题 The Setup So, I have a contenteditable div -- I'm making a WYSIWYG editor: bold, italics, formatting, whatever, and most lately: inserting fancy images (in a fancy box, with a caption). <a class="fancy" href="i.jpg" target="_blank"> <img alt="" src="i.jpg" /> Optional Caption goes Here! </a> The user adds these fancy images with a dialog I present them with: they fill out the details, upload the image, and then much like the other editor functions, I use document.execCommand('insertHTML'

JS library (with drag n drop) compatible with iOS and regular browsers

独自空忆成欢 提交于 2019-12-18 10:13:10
问题 Does anyone know of a JS framework that has drag and drop functionality and is compatible with mobile (iOS) and regular browsers? I currently have a web-based app and it is a hassle to make its drag'n'drop functionality work on iOS... I wish there was one that would do it for both... 回答1: Here's two built in jQuery: http://www.stevefenton.co.uk/cmsfiles/assets/File/mobiledragdrop.html http://code.google.com/p/jquery-ui-for-ipad-and-iphone/ There is also the jquery mobile framework (which does

How to automate angular-drag-and-drop-lists

落花浮王杯 提交于 2019-12-18 09:42:31
问题 Problem : trying to simulate drag drop in frontend that uses angular-drag-and-drop-lists (go to detailed description) Tried : 1.jquery-simulate: Gives following error Uncaught TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'. 2.drag-drop-helper.js : click happens on item to be dragged 3.drag_to : nothing happens Need some more suggestions . Thanks jquery-simulate: https://github.com/jquery/jquery-simulate sorry not able to post link for drag_to

Angular 2: how to conditionally apply attribute directive?

久未见 提交于 2019-12-18 08:39:56
问题 I use drag&drop via ng2-dragula. The drag&drop functionality is applied this way: <div class='container' [dragula]='"first-bag"'> <div>item 1</div> <div>item 2</div> </div> If I understand angular 2 properly, the way how [dragula]='"first-bag"' is attached to my div is called Attribute Directive in Angular 2. Now I have a variable in my component called enableDragNDrop:boolean . How can I use this variable to attach [dragula]='"first-bag"' to my div only when enableDragNDrop == true ? If

How to change style (color, font) of a single JTree node

百般思念 提交于 2019-12-18 08:28:43
问题 I have two JTree in two panels in a JFrame . I want to change the style(color and font) of nodes on drag and drop from one tree to the other.Please provide me a way to change the color of a JTree node permanently. 回答1: To start, you will need to have a data object that can handle style and color. You could subclass DefaultMutableTreeNode and add these data items with getts and setters Then you'd need to create a custom TreeCellRenderer. I recommend extending DefaultTreeCellRenderer, and in

How to change style (color, font) of a single JTree node

狂风中的少年 提交于 2019-12-18 08:28:08
问题 I have two JTree in two panels in a JFrame . I want to change the style(color and font) of nodes on drag and drop from one tree to the other.Please provide me a way to change the color of a JTree node permanently. 回答1: To start, you will need to have a data object that can handle style and color. You could subclass DefaultMutableTreeNode and add these data items with getts and setters Then you'd need to create a custom TreeCellRenderer. I recommend extending DefaultTreeCellRenderer, and in

Drag and drop large virtual files from C# to Windows Explorer

非 Y 不嫁゛ 提交于 2019-12-18 08:26:26
问题 I have a C# WPF application with a section that serves as an FTP client, listing files on a remote server and allowing the user to download them. I want the user to be able to drag and drop files from the file listing onto their own machine (i.e. into a Windows Explorer shell). To accomplish this, I used the VirtualFileDataObject code from Delay's blog, using the Action<Stream> overload of SetData . This works great on smaller files. My problem is: some of the files I'm dealing with are very

Drag and drop large virtual files from C# to Windows Explorer

妖精的绣舞 提交于 2019-12-18 08:25:22
问题 I have a C# WPF application with a section that serves as an FTP client, listing files on a remote server and allowing the user to download them. I want the user to be able to drag and drop files from the file listing onto their own machine (i.e. into a Windows Explorer shell). To accomplish this, I used the VirtualFileDataObject code from Delay's blog, using the Action<Stream> overload of SetData . This works great on smaller files. My problem is: some of the files I'm dealing with are very

Custom drag image with NSTableView as drag source

做~自己de王妃 提交于 2019-12-18 08:24:45
问题 Is it necessary to subclass NSTableView or NSTableCellView to create a custom drag image when the tableView is the drag source? If not, what is the magic method I am missing to do this? I cannot seem to find anything solid. NSTableCellView subclasses have can (slightly mysteriously) override: @property(retain, readonly) NSArray *draggingImageComponents (array of NSDraggingImageComponent instances that will get composited together (who knows in what fashion they get composited...)) NSTableView

Drag and Drop from ListView to TreeView

放肆的年华 提交于 2019-12-18 07:21:57
问题 I just want to drag and drop an item from my ListView to a specific position in my TreeView . I know how to handle DragEvent s. But how can I get the dropped position of my treeView? With "position" I mean "on which treeview-item dropped (get reference from this treeview-item)". package main; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.Event; import javafx.event.EventHandler; import javafx.event