mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
36 lines
661 B
JavaScript
36 lines
661 B
JavaScript
|
|
define(function () {
|
||
|
|
|
||
|
|
var Settings = null,
|
||
|
|
SettingsArea;
|
||
|
|
|
||
|
|
SettingsArea = {
|
||
|
|
types: ['textarea'],
|
||
|
|
use: function () {
|
||
|
|
Settings = this;
|
||
|
|
},
|
||
|
|
create: function () {
|
||
|
|
return Settings.helper.createElement('textarea');
|
||
|
|
},
|
||
|
|
set: function (element, value, trim) {
|
||
|
|
if (trim && value != null && typeof value.trim === 'function') {
|
||
|
|
value = value.trim();
|
||
|
|
}
|
||
|
|
element.val(value || '');
|
||
|
|
},
|
||
|
|
get: function (element, trim, empty) {
|
||
|
|
var value = element.val();
|
||
|
|
if (trim) {
|
||
|
|
value = value == null ? void 0 : value.trim();
|
||
|
|
}
|
||
|
|
if (empty || value) {
|
||
|
|
return value;
|
||
|
|
} else {
|
||
|
|
return void 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
return SettingsArea;
|
||
|
|
|
||
|
|
});
|