mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Removed unused upload directive
This commit is contained in:
parent
7687150a96
commit
e399c328e2
@ -49,38 +49,7 @@ angular.module('kibana.directives', [])
|
||||
}
|
||||
};
|
||||
})
|
||||
// Is this even used anymore? I don't think is is
|
||||
.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() {
|
||||
.directive('ngModelOnblur', function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: 'ngModel',
|
||||
|
Loading…
Reference in New Issue
Block a user