Fixes unexpected behavior of step panel dropdown (#1328)

* Fixes  dropdown

* Update defaultHtmlStepUi.js

* Update intermediateHtmlStepUi.js
This commit is contained in:
keshav234156
2019-12-10 04:29:14 +05:30
committed by Jeffrey Warren
parent 032971d269
commit 2459e53fda
2 changed files with 8 additions and 12 deletions

View File

@@ -15,8 +15,6 @@ const intermediateHtmlStepUi = require('./intermediateHtmlStepUi.js'),
scopeQuery = require('./scopeQuery'); scopeQuery = require('./scopeQuery');
function DefaultHtmlStepUi(_sequencer, options) { function DefaultHtmlStepUi(_sequencer, options) {
let $step, $stepAll;
options = options || {}; options = options || {};
var stepsEl = options.stepsEl || document.querySelector('#steps'); var stepsEl = options.stepsEl || document.querySelector('#steps');
var selectStepSel = options.selectStepSel = options.selectStepSel || '#selectStep'; var selectStepSel = options.selectStepSel = options.selectStepSel || '#selectStep';
@@ -70,12 +68,9 @@ function DefaultHtmlStepUi(_sequencer, options) {
var parser = new DOMParser(); var parser = new DOMParser();
step.ui = parser.parseFromString(step.ui, 'text/html'); step.ui = parser.parseFromString(step.ui, 'text/html');
step.ui = step.ui.querySelector('div.container-fluid'); step.ui = step.ui.querySelector('div.container-fluid');
step.$step = scopeQuery.scopeSelector(step.ui);
$step = scopeQuery.scopeSelector(step.ui); step.$stepAll = scopeQuery.scopeSelectorAll(step.ui);
$stepAll = scopeQuery.scopeSelectorAll(step.ui); let {$step, $stepAll} = step;
step.ui.$step = $step;
step.ui.$stepAll = $stepAll;
step.linkElements = step.ui.querySelectorAll('a'); step.linkElements = step.ui.querySelectorAll('a');
step.imgElement = $step('a img.img-thumbnail')[0]; step.imgElement = $step('a img.img-thumbnail')[0];
@@ -258,13 +253,14 @@ function DefaultHtmlStepUi(_sequencer, options) {
} }
function onDraw() { function onDraw({$step, $stepAll}) {
$step('.load').show(); $step('.load').show();
$step('img').hide(); $step('img').hide();
$stepAll('.load-spin').show(); $stepAll('.load-spin').show();
} }
function onComplete(step) { function onComplete(step) {
let {$step, $stepAll} = step;
$step('img').show(); $step('img').show();
$stepAll('.load-spin').hide(); $stepAll('.load-spin').hide();
$step('.load').hide(); $step('.load').hide();

View File

@@ -75,8 +75,8 @@ function IntermediateHtmlStepUi(_sequencer, step, options) {
}; };
insertStep = function (id) { insertStep = function (id) {
const $step = step.ui.$step, const $step = step.$step,
$stepAll = step.ui.$stepAll; $stepAll = step.$stepAll;
var modulesInfo = _sequencer.modulesInfo(); var modulesInfo = _sequencer.modulesInfo();
var parser = new DOMParser(); var parser = new DOMParser();
var addStepUI = stepUI(); var addStepUI = stepUI();