]> _ Git - cubist_cms-back.git/commitdiff
#2810
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Jun 2019 12:05:24 +0000 (14:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Jun 2019 12:05:24 +0000 (14:05 +0200)
src/app/Magic/Fields/Number.php
src/resources/views/when.blade.php

index aa3135e42c8b18f9e0ad32e23abc3dddfa7249df..88c09c97ba4c0ad0e9f9296c01c46667c4efa220 100644 (file)
@@ -12,11 +12,12 @@ class Number extends Field
     protected $_step = 'any';
     protected $_min = null;
     protected $_max = null;
+    protected $_lang = 'en-150';
 
     public function getDefaultAttributes()
     {
         $res = parent::getDefaultAttributes();
-        $attrs = ['min', 'max', 'step'];
+        $attrs = ['min', 'max', 'step', 'lang'];
         $defaults = [];
         foreach ($attrs as $attr) {
             if (null === $this->{'_' . $attr}) {
index 3ae6a7808b57554badaf685576f6e6ebc305d925..ed64fc0aa54529463d32e78cfe246875339e9f18 100644 (file)
@@ -13,6 +13,9 @@
                     var conditions = $(this).data('when');
                     var match = true;
                     $.each(conditions, function (k, v) {
+                        if (!Array.isArray(v)) {
+                            v = [v];
+                        }
                         var val = $(form).find('[name="' + k + '"]').val();
                         var valnum = parseFloat(val);
                         if (!isNumber(valnum)) {