| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- var custom = false;
- $('#runCaseModal').closest('.modal').off('hide.zui.modal').on('hide.zui.modal', function(e, info)
- {
- const $target = $(e.target);
- if($target.is('.modal') || (Array.isArray(info) && info[0] instanceof zui.Modal))
- {
- const modalID = $target.attr('id');
- if(modalID.indexOf('fileModal') == -1 && modalID.indexOf('stepResultFileModal') == -1) loadCurrentPage();
- }
- });
- /**
- * Load result.
- *
- * @access public
- * @return void
- */
- window.loadResult = function()
- {
- loadCurrentPage({url: resultsLink, selector: '#casesResults', partial: true});
- window.waitDom('#casesResults .result-item', function(){ $('#casesResults .result-item').first().trigger('click');})
- $(document).off('mouseover', 'li.file').on('mouseover', 'li.file', function()
- {
- $(this).children('span.right-icon').removeClass("hidden");
- $(this).addClass('backgroundColor');
- });
- $(document).off('mouseout', 'li.file').on('mouseout', 'li.file', function()
- {
- $(this).children('span.right-icon').addClass("hidden");
- $(this).removeClass('backgroundColor');
- });
- }
- /**
- * When real change.
- *
- * @param event $event
- * @access public
- * @return void
- */
- function realChange(event)
- {
- var $target = $(event.target);
- var $preSelect = $(event.target).closest('table').closest('tr').find('[name^="result"]');
- if($target.val() == '' && $preSelect.val() == 'fail')
- {
- $preSelect.zui('picker').$.changeState({value: 'pass'});
- }
- else if($target.val() != '' && $preSelect.val() == 'pass')
- {
- $preSelect.zui('picker').$.changeState({value: 'fail'});
- setTimeout(function(){$preSelect.closest('.picker-box.form-group-wrapper').addClass('has-error');}, 10);
- setTimeout(function(){$preSelect.closest('.picker-box.form-group-wrapper').removeClass('has-error');}, 1000);
- }
- }
- /**
- * Check step value is changed.
- *
- * @param event $event
- * @access public
- * @return void
- */
- function checkStepValue(event)
- {
- if($(event.target).val() == 'pass') custom = true;
- }
- /**
- * Set height of the file modal.
- *
- * @access public
- * @return void
- */
- function setFileModalHeight()
- {
- $($(this).data('target')).find('.modal-content').css('max-height', $('#runCaseModal').height() + 'px');
- }
|