loopj/jquery-tokeninput — Issue #234: Allow to be readonly
Author: magellings
Created: 2011-12-13 20:44:28+00:00
State: open

// The 'delete token' button
+ if (!settings.readOnly) {
$("" + settings.deleteText + "")
.addClass(settings.classes.tokenDelete)
.appendTo(this_token)
.click(function() {
delete_token($(this).parent());
hidden_input.change();
return false;
});
+ }

this.getTokens = function () {
return saved_tokens;
}

+ if (settings.readOnly) {
+ input_box.attr('disabled', 'true');
+ }

// Callbacks
onResult: null,
onAdd: null,
onDelete: null,
onReady: null,

+ readOnly: false