Skip to content

Commit

Permalink
Minor reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jochen Eddelbüttel committed Dec 1, 2013
1 parent b8f6189 commit e7adc16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions angular-cornercouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ factory('cornercouch', ['$http', function($http) {
// Requires File-API 'file', sorry IE9
CouchDoc.prototype.attach = function(file, nameOrCallback) {

var isF = ng.isFunction(nameOrCallback);
var isF = ng.isFunction(nameOrCallback);
var doc = this;

return $http({
method: "PUT",
url: encodeUri(dbUri, doc._id, !isF && nameOrCallback || file.name),
Expand Down
19 changes: 9 additions & 10 deletions guestbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,17 @@ <h4>{{detail.alias}} wrote at {{detail.utc}} UTC</h4>
};

$scope.attachClick = function() {

var fileInput = document.getElementById("upload");
var idx = 0;

function callback() {
if (idx < fileInput.files.length)
$scope.detail.attach(fileInput.files[idx++], callback).error(setError);
else
fileInput.value = "";
};
var idx = 0;

callback();
function callback() {
if (idx < fileInput.files.length)
$scope.detail.attach(fileInput.files[idx++], callback).error(setError);
else
fileInput.value = "";
};
callback();
};

$scope.detachClick = function(name) {
Expand Down

0 comments on commit e7adc16

Please sign in to comment.