Permalink
Browse files

Allow string or array argument in issue_no_modal, and hide the form j…

…ust in case.
  • Loading branch information...
1 parent fee2843 commit 193bffe0ba622d1e9aa639aa3ac0a295d6af77cc @stenington stenington committed Aug 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 static/js/issuer-parts/issuer-core.js
View
3 static/js/issuer-parts/issuer-core.js
@@ -133,9 +133,10 @@ var OpenBadges = (function() {
// This function is not yet documented publicly.
// It provides a modaless alternative to the classic issuer frame at the cost of the callback.
issue_no_modal: function OpenBadges_issue_no_modal(assertions) {
+ assertions = typeof assertions === 'string' ? [assertions] : assertions;
var root = this.ROOT = findRoot();
var url = root + "issuer/frameless?" + Date.now();
- var form = $('<form method="POST"></form>').attr('action', url).appendTo($('body'));
+ var form = $('<form method="POST"></form>').attr('action', url).appendTo($('body')).hide();
assertions.forEach(function(val, i, arr){
$('<input type="text" name="assertions">').val(val).appendTo(form);
});

0 comments on commit 193bffe

Please sign in to comment.