forked from 0x2620/oxjs
add 'unformat' option to editables
This commit is contained in:
parent
ad4e7dfa9a
commit
e43881c594
3 changed files with 8 additions and 3 deletions
|
|
@ -37,6 +37,7 @@ Ox.Editable = function(options, self) {
|
|||
tags: null,
|
||||
tooltip: '',
|
||||
type: 'input',
|
||||
unformat: null,
|
||||
value: '',
|
||||
width: 0
|
||||
})
|
||||
|
|
@ -199,12 +200,14 @@ Ox.Editable = function(options, self) {
|
|||
|
||||
function formatInputValue() {
|
||||
return self.options.type == 'input'
|
||||
? self.options.value
|
||||
? (self.options.unformat || Ox.identity)(self.options.value)
|
||||
: self.options.value.replace(/<br\/?><br\/?>/g, '\n\n');
|
||||
}
|
||||
|
||||
function formatTestValue() {
|
||||
var value = Ox.encodeHTMLEntities(self.$input.options('value'));
|
||||
var value = Ox.encodeHTMLEntities(
|
||||
(self.options.unformat || Ox.identity)(self.$input.options('value'))
|
||||
);
|
||||
return !value ? ' '
|
||||
: self.options.type == 'input'
|
||||
? value.replace(/ /g, ' ')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue