Skip to content

Commit

Permalink
fixed #462
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Jan 25, 2015
1 parent 9a64a1e commit fe592fb
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 16 deletions.
13 changes: 10 additions & 3 deletions demo/war/js/angular-file-upload-all.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload/drop directive and service with progress and abort
* @author Danial <danial.farid@gmail.com>
* @version 2.2.0
* @version 2.2.1
*/
(function() {

Expand All @@ -26,7 +26,7 @@ if (window.XMLHttpRequest && !window.XMLHttpRequest.__isFileAPIShim) {
}

var angularFileUpload = angular.module('angularFileUpload', []);
angularFileUpload.version = '2.2.0';
angularFileUpload.version = '2.2.1';
angularFileUpload.service('$upload', ['$http', '$q', '$timeout', function($http, $q, $timeout) {
function sendHttp(config) {
config.method = config.method || 'POST';
Expand Down Expand Up @@ -201,6 +201,13 @@ function handleFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile
if (attr['multiple']) fileElem.attr('multiple', attr['multiple']);
if (attr['accept']) fileElem.attr('accept', attr['accept']);
if (attr['capture']) fileElem.attr('capture', attr['capture']);
for (var key in attr) {
if (key.indexOf('inputFile') == 0) {
var name = key.substring('inputFile'.length);
name = name[0].toLowerCase() + name.substring(1);
fileElem.attr(name, attr[key]);
}
}

fileElem.css('width', '1px').css('height', '1px').css('opacity', 0).css('position', 'absolute').css('filter', 'alpha(opacity=0)')
.css('padding', 0).css('margin', 0).css('overflow', 'hidden').attr('tabindex', '-1').attr('ng-file-generated-elem', true);
Expand Down Expand Up @@ -520,7 +527,7 @@ function globStringToRegex(str) {
* AngularJS file upload/drop directive and service with progress and abort
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <danial.farid@gmail.com>
* @version 2.2.0
* @version 2.2.1
*/

(function() {
Expand Down
7 changes: 7 additions & 0 deletions demo/war/js/angular-file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ function handleFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile
if (attr['multiple']) fileElem.attr('multiple', attr['multiple']);
if (attr['accept']) fileElem.attr('accept', attr['accept']);
if (attr['capture']) fileElem.attr('capture', attr['capture']);
for (var key in attr) {
if (key.indexOf('inputFile') == 0) {
var name = key.substring('inputFile'.length);
name = name[0].toLowerCase() + name.substring(1);
fileElem.attr(name, attr[key]);
}
}

fileElem.css('width', '1px').css('height', '1px').css('opacity', 0).css('position', 'absolute').css('filter', 'alpha(opacity=0)')
.css('padding', 0).css('margin', 0).css('overflow', 'hidden').attr('tabindex', '-1').attr('ng-file-generated-elem', true);
Expand Down
13 changes: 10 additions & 3 deletions dist/angular-file-upload-all.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload/drop directive and service with progress and abort
* @author Danial <danial.farid@gmail.com>
* @version 2.2.0
* @version 2.2.1
*/
(function() {

Expand All @@ -26,7 +26,7 @@ if (window.XMLHttpRequest && !window.XMLHttpRequest.__isFileAPIShim) {
}

var angularFileUpload = angular.module('angularFileUpload', []);
angularFileUpload.version = '2.2.0';
angularFileUpload.version = '2.2.1';
angularFileUpload.service('$upload', ['$http', '$q', '$timeout', function($http, $q, $timeout) {
function sendHttp(config) {
config.method = config.method || 'POST';
Expand Down Expand Up @@ -201,6 +201,13 @@ function handleFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile
if (attr['multiple']) fileElem.attr('multiple', attr['multiple']);
if (attr['accept']) fileElem.attr('accept', attr['accept']);
if (attr['capture']) fileElem.attr('capture', attr['capture']);
for (var key in attr) {
if (key.indexOf('inputFile') == 0) {
var name = key.substring('inputFile'.length);
name = name[0].toLowerCase() + name.substring(1);
fileElem.attr(name, attr[key]);
}
}

fileElem.css('width', '1px').css('height', '1px').css('opacity', 0).css('position', 'absolute').css('filter', 'alpha(opacity=0)')
.css('padding', 0).css('margin', 0).css('overflow', 'hidden').attr('tabindex', '-1').attr('ng-file-generated-elem', true);
Expand Down Expand Up @@ -520,7 +527,7 @@ function globStringToRegex(str) {
* AngularJS file upload/drop directive and service with progress and abort
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <danial.farid@gmail.com>
* @version 2.2.0
* @version 2.2.1
*/

(function() {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-file-upload-all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-file-upload-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* AngularJS file upload/drop directive and service with progress and abort
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <danial.farid@gmail.com>
* @version 2.2.0
* @version 2.2.1
*/

(function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-shim.min.js

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

11 changes: 9 additions & 2 deletions dist/angular-file-upload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload/drop directive and service with progress and abort
* @author Danial <danial.farid@gmail.com>
* @version 2.2.0
* @version 2.2.1
*/
(function() {

Expand All @@ -26,7 +26,7 @@ if (window.XMLHttpRequest && !window.XMLHttpRequest.__isFileAPIShim) {
}

var angularFileUpload = angular.module('angularFileUpload', []);
angularFileUpload.version = '2.2.0';
angularFileUpload.version = '2.2.1';
angularFileUpload.service('$upload', ['$http', '$q', '$timeout', function($http, $q, $timeout) {
function sendHttp(config) {
config.method = config.method || 'POST';
Expand Down Expand Up @@ -201,6 +201,13 @@ function handleFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile
if (attr['multiple']) fileElem.attr('multiple', attr['multiple']);
if (attr['accept']) fileElem.attr('accept', attr['accept']);
if (attr['capture']) fileElem.attr('capture', attr['capture']);
for (var key in attr) {
if (key.indexOf('inputFile') == 0) {
var name = key.substring('inputFile'.length);
name = name[0].toLowerCase() + name.substring(1);
fileElem.attr(name, attr[key]);
}
}

fileElem.css('width', '1px').css('height', '1px').css('opacity', 0).css('position', 'absolute').css('filter', 'alpha(opacity=0)')
.css('padding', 0).css('margin', 0).css('overflow', 'hidden').attr('tabindex', '-1').attr('ng-file-generated-elem', true);
Expand Down
Loading

0 comments on commit fe592fb

Please sign in to comment.