Skip to content

Commit

Permalink
set preventDefault to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilson committed Mar 17, 2013
1 parent 0d5c559 commit 8f5c634
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.3.2

* added preventDefault to click event

# 0.3.1

* Changed form detection to use .parents method instead of passing by scope
Expand Down
4 changes: 3 additions & 1 deletion examples/nodejs/libs/js/ng-upload.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Version 0.3.1
// Version 0.3.2
// AngularJS simple file upload directive
// this directive uses an iframe as a target
// to enable the uploading of files without
Expand Down Expand Up @@ -49,6 +49,8 @@ angular.module('ngUpload', [])
}

element.bind('click', function() {
// prevent default behavior of click
$event.preventDefault = true;
// create a new iframe
var iframe = angular.element("<iframe id='upload_iframe' name='upload_iframe' border='0' width='0' height='0' style='width: 0px; height: 0px; border: none; display: none' />");

Expand Down
6 changes: 4 additions & 2 deletions ng-upload.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Version 0.3.1
// Version 0.3.2
// AngularJS simple file upload directive
// this directive uses an iframe as a target
// to enable the uploading of files without
Expand Down Expand Up @@ -48,7 +48,9 @@ angular.module('ngUpload', [])
throw message + "\n";
}

element.bind('click', function() {
element.bind('click', function($event) {
// prevent default behavior of click
$event.preventDefault = true;
// create a new iframe
var iframe = angular.element("<iframe id='upload_iframe' name='upload_iframe' border='0' width='0' height='0' style='width: 0px; height: 0px; border: none; display: none' />");

Expand Down
2 changes: 1 addition & 1 deletion ng-upload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An AngularJS file upload directive.

## 0.3.1 - for updates see CHANGELOG.md
## 0.3.2 - for updates see CHANGELOG.md

``` html
<form ng-upload action="/upload-full-form">
Expand Down

0 comments on commit 8f5c634

Please sign in to comment.