mirror of
https://github.com/lrsjng/jquery-qrcode.git
synced 2026-08-12 20:01:55 +08:00
Fixes.
This commit is contained in:
+3
-10
@@ -10,8 +10,6 @@
|
||||
// Wrapper for the original QR code generator.
|
||||
var QRCode = function (version, level, text) {
|
||||
|
||||
try {
|
||||
|
||||
// `qrcode` is the single public function that will be defined by the `QR Code Generator`
|
||||
// at the end of the file.
|
||||
var qr = qrcode(version, level);
|
||||
@@ -50,10 +48,6 @@
|
||||
this.moduleCount = moduleCount;
|
||||
this.isDark = isDark;
|
||||
this.extIsDarkFn = extIsDarkFn;
|
||||
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
// Check if canvas is available in the browser (as Modernizr does)
|
||||
@@ -70,10 +64,9 @@
|
||||
minVersion = Math.max(1, minVersion);
|
||||
maxVersion = Math.min(40, maxVersion);
|
||||
for (var version = minVersion; version <= maxVersion; version += 1) {
|
||||
var qr = new QRCode(version, level, text);
|
||||
if (qr) {
|
||||
return qr;
|
||||
}
|
||||
try {
|
||||
return new QRCode(version, level, text);
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user