检测发生下降的位置(ng-flow)
Detect where drop occured (ng-flow)
我正在使用 ng-flow 拖放文件并上传到服务器。我正在开发的页面有多个 drop listeners 。有没有办法检测掉落发生在哪个元素上?
<body ng-app="droptest" flow-init="{target:''}">
<div name="drop1" class="fa fa-paperclip fa-rotate-90 Cell small" flow-drop="" title="Drag/Drop files to upload to this record"></div>
<div name="drop2" class="fa fa-paperclip fa-rotate-90 Cell small" flow-drop="" title="Drag/Drop files to upload to this record"></div>
</body>
$scope.$on('flow::fileAdded', function (event, $flow, flowFile) {
//how to detect whether drop occured on drop1 or drop2?
});
我想通了
$scope.$on('flow::fileAdded', function (event, $flow, flowFile, elementDetails) {
elementDetails.target
});
我正在使用 ng-flow 拖放文件并上传到服务器。我正在开发的页面有多个 drop listeners 。有没有办法检测掉落发生在哪个元素上?
<body ng-app="droptest" flow-init="{target:''}">
<div name="drop1" class="fa fa-paperclip fa-rotate-90 Cell small" flow-drop="" title="Drag/Drop files to upload to this record"></div>
<div name="drop2" class="fa fa-paperclip fa-rotate-90 Cell small" flow-drop="" title="Drag/Drop files to upload to this record"></div>
</body>
$scope.$on('flow::fileAdded', function (event, $flow, flowFile) {
//how to detect whether drop occured on drop1 or drop2?
});
我想通了
$scope.$on('flow::fileAdded', function (event, $flow, flowFile, elementDetails) {
elementDetails.target
});