OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/frontend/app/components/work-packages/wp-attachments-formattable-.../models/paste-model.ts

23 lines
571 B

import IAugmentedJQuery = angular.IAugmentedJQuery;
import {WorkPackageResourceInterface} from '../../../api/api-v3/hal-resources/work-package-resource.service';
export class PasteModel {
public files:File[] = [];
constructor(protected dataTransfer:DataTransfer) {
this.extractFiles(dataTransfer.files);
}
private extractFiles(items:FileList):void {
if (!items) {
return;
}
for (let i = 0; i < items.length; i++) {
if (items[i].type.indexOf("image") !== -1) {
//image
this.files.push(items[i]);
}
}
}
}