Add 'exact' field preset type to input.preset.js
This commit is contained in:
parent
c0f14b33a7
commit
fe24864d87
|
|
@ -244,7 +244,10 @@
|
|||
}
|
||||
|
||||
InputPreset.prototype.formatValue = function() {
|
||||
if (this.options.inputPresetType == 'namespace') {
|
||||
if (this.options.inputPresetType == 'exact') {
|
||||
return this.$src.val();
|
||||
}
|
||||
else if (this.options.inputPresetType == 'namespace') {
|
||||
return this.formatNamespace()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3883,7 +3883,8 @@ $el.val(prefix+self.formatValue())})
|
|||
this.$el.on('change',function(){self.cancelled=true})}
|
||||
InputPreset.prototype.formatNamespace=function(){var value=toCamel(this.$src.val())
|
||||
return value.substr(0,1).toUpperCase()+value.substr(1)}
|
||||
InputPreset.prototype.formatValue=function(){if(this.options.inputPresetType=='namespace'){return this.formatNamespace()}
|
||||
InputPreset.prototype.formatValue=function(){if(this.options.inputPresetType=='exact'){return this.$src.val();}
|
||||
else if(this.options.inputPresetType=='namespace'){return this.formatNamespace()}
|
||||
if(this.options.inputPresetType=='camel'){var value=toCamel(this.$src.val())}
|
||||
else{var value=slugify(this.$src.val())}
|
||||
if(this.options.inputPresetType=='url'){value='/'+value}
|
||||
|
|
|
|||
Loading…
Reference in New Issue