@@ -155,11 +155,12 @@ export default function () {
155
155
for ( gridId in specifications ) {
156
156
var specArray = specifications [ gridId ]
157
157
if ( Array . isArray ( specArray ) ) {
158
- // add one spec object per grid only
159
- var specValue = addSpec ( gridId , 'spec' , true )
160
- if ( specValue ) {
161
- specValue ( specArray [ 0 ] . text )
162
- }
158
+ specArray . forEach ( ( { text } ) => {
159
+ var specValue = addSpec ( gridId , 'spec' , true )
160
+ if ( specValue ) {
161
+ specValue ( text )
162
+ }
163
+ } )
163
164
}
164
165
}
165
166
}
@@ -1843,10 +1844,6 @@ export default function () {
1843
1844
$input = $specs . find ( 'input' ) . filter ( function ( ) {
1844
1845
return $ ( this ) . data ( 'grid' ) === gridId
1845
1846
} )
1846
- if ( $input . length ) {
1847
- $input . focus ( )
1848
- return
1849
- }
1850
1847
// create DOM elements for specification grid
1851
1848
$input = $ ( '<input>' , {
1852
1849
class : 'form-control' ,
@@ -1942,9 +1939,7 @@ export default function () {
1942
1939
1943
1940
if ( ! skipData ) {
1944
1941
// mount specification object
1945
- var specObject = {
1946
- text : text
1947
- }
1942
+ var specObject = { text }
1948
1943
// optional value
1949
1944
if ( value ) {
1950
1945
specObject . value = value
@@ -2050,22 +2045,20 @@ export default function () {
2050
2045
const hourPattern = hasHourPattern ? ' 99:99:99' : ''
2051
2046
if ( hasHourPattern ) {
2052
2047
$ ( `#t${ tabId } -price-effective-dates` )
2053
- . val ( null )
2054
- . inputmask ( lang === 'pt_br' ? `99/99/9999${ hourPattern } ~ 99/99/9999${ hourPattern } ` : `99-99-9999${ hourPattern } ~ 99-99-9999${ hourPattern } ` )
2048
+ . val ( null )
2049
+ . inputmask ( lang === 'pt_br' ? `99/99/9999${ hourPattern } ~ 99/99/9999${ hourPattern } ` : `99-99-9999${ hourPattern } ~ 99-99-9999${ hourPattern } ` )
2055
2050
}
2056
2051
} )
2057
2052
const parseHourDate = ( dateStr ) => {
2058
- const [ datePart , timePart ] = dateStr . split ( ' ' ) ;
2059
- const [ day , month , year ] = datePart . split ( / [ / - ] / ) . map ( s => Number ( s ) ) ;
2060
-
2053
+ const [ datePart , timePart ] = dateStr . split ( ' ' )
2054
+ const [ day , month , year ] = datePart . split ( / [ / - ] / ) . map ( s => Number ( s ) )
2061
2055
if ( timePart ) {
2062
- const [ hour , min , sec ] = timePart . split ( ':' ) . map ( s => Number ( s ) ) ;
2063
- return { day, month, year, hour, min, sec } ;
2056
+ const [ hour , min , sec ] = timePart . split ( ':' ) . map ( s => Number ( s ) )
2057
+ return { day, month, year, hour, min, sec }
2064
2058
}
2065
-
2066
- return { day, month, year } ;
2059
+ return { day, month, year }
2067
2060
}
2068
-
2061
+
2069
2062
const $priceEffectiveDates = $ ( `#t${ tabId } -price-effective-dates` )
2070
2063
. inputmask ( lang === 'pt_br' ? `99/99/9999 ~ 99/99/9999` : `99-99-9999 ~ 99-99-9999` )
2071
2064
. change ( function ( ) {
0 commit comments