From b99a8d5f7ad2a6219cbf626bb773c0fd655d9841 Mon Sep 17 00:00:00 2001 From: ChangHyun Lee Date: Wed, 5 Apr 2017 15:08:45 +0900 Subject: [PATCH] [TIC-Web] fix the bug for import dialog - change the color of url - fix the status of ok button Change-Id: I2d1018adb19f92ee06245c5301d53e0b9c8955be Signed-off-by: ChangHyun Lee --- public/src/css/style.css | 2 +- public/src/js/page/import.js | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/public/src/css/style.css b/public/src/css/style.css index 1eadbfa..b1c73fb 100644 --- a/public/src/css/style.css +++ b/public/src/css/style.css @@ -421,7 +421,7 @@ tr.extended_job_table_row:hover td { display: block; padding: 5px; border: 1px solid #CCC; - color: #08c; + color: #333; background: #eee; max-width: 100%; } diff --git a/public/src/js/page/import.js b/public/src/js/page/import.js index e1e68be..af9c63d 100644 --- a/public/src/js/page/import.js +++ b/public/src/js/page/import.js @@ -55,21 +55,19 @@ define([ _getRecipe() .then(function (recipes) { - resolve(recipes); $('#tic-import-dialog').modal('hide'); + resolve(recipes); }) .catch(function (err) { _.remove(recipeStore, function (item) { return item === recipeItem; }); - $('#tic-import-recipe-confirm-ok').prop('disabled', false); + $('#tic-import-recipe-confirm-ok').prop('disabled', true); $inputDom.parent().removeClass('has-success').addClass('has-error'); var helpDomContent = ''; var helpDomId = '#'+ radioId + '-help'; $(helpDomId).append(helpDomContent); - - resolve(); }) }); }); @@ -83,6 +81,8 @@ define([ if (value.checked === false ) { if (dom.type === 'url' || dom.type === 'text') { $(dom).val('').change(); + var idDomQuery = '#' + value.id + '-help'; + $(idDomQuery).empty(); } } }); @@ -104,15 +104,20 @@ define([ unique: function($el) { var input = $el.val().trim(); if (_.isEmpty(input)) { + $('#tic-import-recipe-confirm-ok').prop('disabled', true); + return; + } + if (!Util.validateURL(input)) { + $('#tic-import-recipe-confirm-ok').prop('disabled', true); return; } var duplicatedUrl = _.filter(recipeStore, ['url', input]); - if (Util.validateURL(input) && !_.isEmpty(duplicatedUrl)) { + if ( !_.isEmpty(duplicatedUrl)) { $('#tic-import-recipe-confirm-ok').prop('disabled', true); return 'URL is already in use.'; - } else { - $('#tic-import-recipe-confirm-ok').prop('disabled', false); } + $('#tic-import-recipe-confirm-ok').prop('disabled', false); + return; } } }); -- 2.7.4