Commit 619eab6a authored by Yadd's avatar Yadd
Browse files

First version of "download" button (#878)

parent 48947213
......@@ -24,5 +24,9 @@
buttons=[{
"title": "cancel",
"icon": "remove"
},{
"title": "save",
"icon": "save",
"action": "localDownload"
}];
</script>
......@@ -804,6 +804,7 @@
$location.path('/confs/latest');
}
/* File form function */
$scope.replaceContentByUrl = function(node, url) {
$scope.waiting = true;
$http.post(scriptname + "prx", {
......@@ -813,11 +814,15 @@
$scope.waiting = false;
}).error(readError);
}
/* Update currentNode.data (used for file form */
$scope.replaceContent = function(node, $fileContent) {
node.data = $fileContent;
};
$scope.localDownload = function() {
var b = new Blob([$scope.currentNode.data], {
type: "text/plain"
});
window.open(URL.createObjectURL(b));
};
}]);
})();
\ No newline at end of file
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