Commit e399c328 by Rashid Khan

Removed unused upload directive

parent 7687150a
...@@ -49,38 +49,7 @@ angular.module('kibana.directives', []) ...@@ -49,38 +49,7 @@ angular.module('kibana.directives', [])
} }
}; };
}) })
// Is this even used anymore? I don't think is is .directive('ngModelOnblur', function() {
.directive('upload', function(timer,dashboard){
return {
restrict: 'A',
link: function(scope, elem, attrs) {
function file_selected(evt) {
var files = evt.target.files; // FileList object
// files is a FileList of File objects. List some properties.
var output = [];
for (var i = 0, f; f = files[i]; i++) {
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
dashboard.dash_load(JSON.parse(e.target.result))
scope.$apply();
};
})(f);
reader.readAsText(f);
}
}
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Something
document.getElementById('upload').addEventListener('change', file_selected, false);
} else {
alert('Sorry, the HTML5 File APIs are not fully supported in this browser.');
}
}
}
}).directive('ngModelOnblur', function() {
return { return {
restrict: 'A', restrict: 'A',
require: 'ngModel', require: 'ngModel',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment