escape method in abstract input

This commit is contained in:
vitalets 2012-11-29 13:39:52 +04:00
parent 7f306aacbe
commit e24322bc52
2 changed files with 12 additions and 2 deletions

@ -46,7 +46,7 @@ To create your own input you should inherit from this class.
@param {DOMElement} element
**/
value2html: function(value, element) {
var html = $('<div>').text(value).html();
var html = this.escape(value);
$(element).html(html);
},
@ -120,6 +120,13 @@ To create your own input you should inherit from this class.
**/
clear: function() {
this.$input.val(null);
},
/**
method to escape html
**/
escape: function(str) {
return $('<div>').text(str).html();
}
};

@ -1,5 +1,6 @@
/**
List of checkboxes. Internally value stored as javascript array of values.
List of checkboxes.
Internally value stored as javascript array of values.
@class checklist
@extends list
@ -49,6 +50,8 @@ $(function(){
value2str: function(value) {
return $.isArray(value) ? value.join($.trim(this.options.separator)) : '';
//it is also possible to sent as array
//return value;
},
//parse separated string