Last active
June 22, 2017 12:51
-
-
Save StErMi/3614854278979b0c46c6d8000593a299 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init: function() { | |
this.setAggregation("__qrcodeHTML", new HTML({ | |
content: "<div class='openui5-qrcode' id='" + this.getId() + "-qrcode'></div>" | |
})); | |
}, | |
onAfterRendering: function() { | |
var iCorrectLevel = this.getCorrectLevel() < 0 || this.getCorrectLevel() > 3 ? QRCode.CorrectLevel.H : this.getCorrectLevel(); | |
if( this.__qrcode ) { | |
this.__qrcode._htOption.width = this.getWidth(); | |
this.__qrcode._htOption.height = this.getHeight(); | |
this.__qrcode._htOption.colorDark = this.getColorDark(); | |
this.__qrcode._htOption.colorLight = this.getColorLight(); | |
this.__qrcode._htOption.correctLevel = iCorrectLevel; | |
if( this.getText() ) { | |
this.__qrcode.makeCode( this.getText() ); | |
} else { | |
this.__qrcode.clear(); | |
} | |
} else { | |
this.destroyQRCode(); | |
this.__qrcode = new QRCode( jQuery.sap.domById( this.getId() + "-qrcode" ), { | |
text: this.getText(), | |
width: this.getWidth(), | |
height: this.getHeight(), | |
colorDark: this.getColorDark(), | |
colorLight: this.getColorLight(), | |
correctLevel: iCorrectLevel | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment