Merge branch 'develop'

This commit is contained in:
Lars Jung
2013-07-09 15:17:40 +02:00
3 changed files with 12 additions and 7 deletions
+6 -1
View File
@@ -10,7 +10,12 @@ Uses [QR Code Generator](http://www.d-project.com/qrcode/index.html) (MIT). Kudo
## Changelog ## Changelog
### v0.3 - *2012-06-01* ### v0.4 - *2013-07-09*
* fixes missing default values in some cases
### v0.3 - *2013-06-01*
* adds option to draw on existing canvas * adds option to draw on existing canvas
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"name": "jquery.qrcode", "name": "jquery.qrcode",
"displayName": "jQuery.qrcode", "displayName": "jQuery.qrcode",
"version": "0.3" "version": "0.4"
} }
+5 -5
View File
@@ -149,9 +149,7 @@
return $div; return $div;
}, },
createHTML = function (options) { createHTML = function (settings) {
var settings = $.extend({}, defaults, options);
return canvasAvailable && settings.render === 'canvas' ? createCanvas(settings) : createDiv(settings); return canvasAvailable && settings.render === 'canvas' ? createCanvas(settings) : createDiv(settings);
}, },
@@ -188,12 +186,14 @@
// ------------------- // -------------------
$.fn.qrcode = function(options) { $.fn.qrcode = function(options) {
var settings = $.extend({}, defaults, options);
return this.each(function () { return this.each(function () {
if (this.nodeName.toLowerCase() === 'canvas') { if (this.nodeName.toLowerCase() === 'canvas') {
drawOnCanvas(this, options); drawOnCanvas(this, settings);
} else { } else {
$(this).append(createHTML(options)); $(this).append(createHTML(settings));
} }
}); });
}; };