Merge pull request #2219 from Herlevsen/input_preset_normal

Add 'normal' field preset type
This commit is contained in:
Samuel Georges 2016-08-06 08:52:56 +10:00 committed by GitHub
commit 72095c3982
2 changed files with 6 additions and 2 deletions

View File

@ -249,7 +249,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}