drag-and-drop

How to distinguish folders and files drag and drop Ajax upload in FireFox

♀尐吖头ヾ 提交于 2020-01-03 02:25:10
问题 I can not find the way to distinguish between folders and files drop in FireFox Ajax. Looks like there are no signs in FireFox FileAPI that can tell if this is a folder or a file. However I see that Google docs somehow can distinguish between folders and files drop. It does not relie on extensions or file length, files without extensions are uploaded correctly, as well as 0-lenth files are uploaded with no problem. How do I distinguish between files and folders during D&D in FF? 回答1: This

JTable Drag and Drop using TransferHandler

▼魔方 西西 提交于 2020-01-03 02:14:07
问题 Currently I am having two tables say Table-A, Table-B . My task is to drag rows from Table-A to Table-B or drag rows from Table-B on to itself. Using TransferHandler I have achieved this task. But my problem is, I am not able to recognize from which table row was dragged to Table-B .. i.e, either from Table-A to Table-B or from Table-B on to itself. In exportData method of TransferHandler I am adding some additional data to one of the column. Basing on this, when I am importing data through

Famo.us: get the new position of a draggable Surface

…衆ロ難τιáo~ 提交于 2020-01-03 00:53:12
问题 After using drag and drop on a surface I want to get the exact new position of this Surface. How can I do that? 回答1: You will be able to get the position from your Draggable modifier on end event draggable.on('end',function(e){var pos = e.position;}) Here is a link for the following code example : var mainContext = Engine.createContext(); var transTransform = new TransitionableTransform(); transTransform.set(Transform.translate(100, 0, 0)); var surface = new Surface({ size: [300, 100],

Building drag and drop interface on iphone

时光毁灭记忆、已成空白 提交于 2020-01-02 23:12:13
问题 I am trying to build an app which will have a bunch of cards that the user needs to drag and drop them onto specific drop zones. How would one go about detecting this and if the card is not on the drop zone then it should slide back. Any suggestions on how to structure this app? 回答1: View.center test against your boundary bounds. something like this maybe: if(((draggedBox.center.x >= droppingBox.origin.x) && (draggedBox.center.y <= droppingBox.origin.y)) && (draggedBox.center.x <=

Implementing Drag n Drop using JQuery

喜欢而已 提交于 2020-01-02 19:45:07
问题 I am developing a MVC application wherein I have to implement Drag n Drop functionality. I also want to get the source as well as target items/ records in the table/ div once the item is dropped on a target place. Then both the source and target values will be passed to the action method defined in the controller to update the same in the database. Can anyone please suggest some links? 回答1: Use http://api.jquery.com/serialize/ to pass your data and jQuery UI sortables http://jqueryui.com

Drag'N'Drop custom widget items between QListWidgets

China☆狼群 提交于 2020-01-02 08:53:28
问题 i am currently working on a Python program, where i want to move items from one QListWidget to another with Drag and Drop. i read this thread, and implemented the Drag and Drop as described. It works with standard QListWidgetItems. The Problem is, i wanna do this custom widgets inside the QListWidgetItems, as described here, to store an icon and several lines into 1 QListWidgetItem. So when i now drag and drop an item into another list, it is empty, because it seems just to move/copy the

dragging and dropping images into a Web page and automatically resizing them with HTML File API

倖福魔咒の 提交于 2020-01-02 08:44:10
问题 I want to create Web pages that allow users to drag and drop images into boxes in various parts of the page, so that they can then print the pages with their images. I want the image to automatically resize when it's dropped in the box. I combined some of the code at http://html5demos.com/file-api with some of the code at http://html5demos.com/file-api-simple to get something like I want. In the current version of the code (below), the image width does not resize the first time you drop the

How to tell if a modifier key is down during drop on Dock

纵饮孤独 提交于 2020-01-02 07:52:12
问题 My Cocoa application supports dropping files onto its Dock icon, but I'd like different behavior depending on whether a modifier key is held down (Command, Option, etc.). I tried checking the modifierFlags for the currentEvent , but they are the same regardless of whether a modifier is held down, or not (I was testing with the Option key). Code: // Code is inside my AppDelegate - (void)application:(NSApplication *)theApplication openFiles:(NSArray *)files { BOOL optDown = (([[NSApp

How to tell if a modifier key is down during drop on Dock

情到浓时终转凉″ 提交于 2020-01-02 07:52:06
问题 My Cocoa application supports dropping files onto its Dock icon, but I'd like different behavior depending on whether a modifier key is held down (Command, Option, etc.). I tried checking the modifierFlags for the currentEvent , but they are the same regardless of whether a modifier is held down, or not (I was testing with the Option key). Code: // Code is inside my AppDelegate - (void)application:(NSApplication *)theApplication openFiles:(NSArray *)files { BOOL optDown = (([[NSApp

Chrome cuts off ghost image when using position sticky/fixed

♀尐吖头ヾ 提交于 2020-01-02 07:14:09
问题 I'm attempting to use HTML5 drag and drop and position: fixed to drag elements from a menu that stays in a fixed position on the left-side of the screen. The following code works fine in Safari and Firefox, but when I try it in Chrome, after scrolling, the "ghost" image produced from the drag and drop API is not visible. If you scroll just right, you can drag a portion of the ghost image, which indicates to me that it's being clipped in some strange fashion. Setting the position of the left