From 8ca1f8b7a3abb151f9cec4c88c262f600b102382 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 7 Mar 2015 11:14:03 +1100 Subject: [PATCH] Discovered an undoc feature "data-input-preset-prefix-input"... added to API as "prefixInput" --- modules/backend/assets/js/october.inputpreset.js | 2 ++ modules/backend/classes/FormField.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/modules/backend/assets/js/october.inputpreset.js b/modules/backend/assets/js/october.inputpreset.js index 87f7a1a46..428ed85b7 100644 --- a/modules/backend/assets/js/october.inputpreset.js +++ b/modules/backend/assets/js/october.inputpreset.js @@ -10,6 +10,8 @@ * for the source and destination input elements. * - data-input-preset-type: specifies the conversion type. Supported values are: * url, file, slug, camel. + * - data-input-preset-prefix-input: optional, prefixes the converted value with the value found + * in the supplied input element using a CSS selector. * * Example: * 'form' ]; + if ($prefixInput = array_get($this->preset, 'prefixInput')) { + $newAttributes['data-input-preset-prefix-input'] = $prefixInput; + } + $attributes = $attributes + $newAttributes; return $attributes; }