Add 'exact' field preset type to input.preset.js

This commit is contained in:
Jens Herlevsen 2016-07-17 02:56:09 +02:00
parent c0f14b33a7
commit fe24864d87
2 changed files with 6 additions and 2 deletions

View File

@ -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()
}

View File

@ -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}