Commit 2b236613 authored by Utkarsh Gupta's avatar Utkarsh Gupta

Remote var from weight_select.js

parent 5aace8a5
/* eslint-disable one-var, no-var, no-shadow, no-else-return */ /* eslint-disable no-shadow, no-else-return */
import $ from 'jquery'; import $ from 'jquery';
import '~/gl_dropdown'; import '~/gl_dropdown';
...@@ -7,11 +7,10 @@ function WeightSelect(els, options = {}) { ...@@ -7,11 +7,10 @@ function WeightSelect(els, options = {}) {
const $els = $(els || '.js-weight-select'); const $els = $(els || '.js-weight-select');
$els.each((i, dropdown) => { $els.each((i, dropdown) => {
var $block, $dropdown, $selectbox, $value; const $dropdown = $(dropdown);
$dropdown = $(dropdown); const $selectbox = $dropdown.closest('.selectbox');
$selectbox = $dropdown.closest('.selectbox'); const $block = $selectbox.closest('.block');
$block = $selectbox.closest('.block'); const $value = $block.find('.value');
$value = $block.find('.value');
$block.find('.block-loading').fadeOut(); $block.find('.block-loading').fadeOut();
const fieldName = options.fieldName || $dropdown.data('fieldName'); const fieldName = options.fieldName || $dropdown.data('fieldName');
const inputField = $dropdown.closest('.selectbox').find(`input[name='${fieldName}']`); const inputField = $dropdown.closest('.selectbox').find(`input[name='${fieldName}']`);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment