Skip to content

Commit

Permalink
[import] Fix drag and drop
Browse files Browse the repository at this point in the history
Fixes #661
  • Loading branch information
mohsen1 committed Sep 22, 2015
1 parent 4bd5dbc commit e3351b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"SwaggerEditor": false,
"SparkMD5": false,
"JSONFormatter": false,
"JSONSchemaView": false
"JSONSchemaView": false,
"File"
}
}
5 changes: 2 additions & 3 deletions app/scripts/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ SwaggerEditor.controller('MainCtrl', function MainCtrl(

// Watch for dropped files and trigger file reader
$scope.$watch('draggedFiles', function () {
var file = _.isArray($scope.draggedFiles) && $scope.draggedFiles[0];

if (file) {
fileReader.readAsText(file, 'utf-8');
if ($scope.draggedFiles instanceof File) {
fileReader.readAsText($scope.draggedFiles, 'utf-8');
}
});

Expand Down

0 comments on commit e3351b1

Please sign in to comment.