diff --git a/editor/js/ui/deploy.js b/editor/js/ui/deploy.js index 9ac340fcd..b94add055 100644 --- a/editor/js/ui/deploy.js +++ b/editor/js/ui/deploy.js @@ -32,7 +32,7 @@ RED.deploy = (function() { function changeDeploymentType(type) { deploymentType = type; - $("#btn-deploy img").attr("src",deploymentTypes[type].img); + $("#btn-deploy-icon").attr("src",deploymentTypes[type].img); } var currentDiff = null; @@ -50,7 +50,15 @@ RED.deploy = (function() { if (type == "default") { $('
  • '+ - ' '+RED._("deploy.deploy")+''+ + ''+ + ''+ + ' '+ + ''+RED._("deploy.deploy")+''+ + ''+ + ''+ + ''+ + ''+ + ''+ ''+ '
  • ').prependTo(".header-toolbar"); RED.menu.init({id:"btn-deploy-options", @@ -69,8 +77,14 @@ RED.deploy = (function() { $('
  • '+ ''+ - (icon?' ':'')+ - ''+label+''+ + ''+ + (icon?' ':'')+ + ''+label+''+ + ''+ + ''+ + ''+ + ''+ + ''+ '
  • ').prependTo(".header-toolbar"); } @@ -519,9 +533,7 @@ RED.deploy = (function() { function save(skipValidation,force) { - if (RED.nodes.dirty()) { - //$("#debug-tab-clear").click(); // uncomment this to auto clear debug on deploy - + if (!$("#btn-deploy").hasClass("disabled")) { if (!skipValidation) { var hasUnknown = false; var hasInvalid = false; @@ -590,8 +602,9 @@ RED.deploy = (function() { var nns = RED.nodes.createCompleteNodeSet(); - $("#btn-deploy-icon").removeClass('fa-download'); - $("#btn-deploy-icon").addClass('spinner'); + $(".deploy-button-content").css('opacity',0); + $(".deploy-button-spinner").show(); + $("#btn-deploy").addClass("disabled"); var data = {flows:nns}; @@ -641,6 +654,7 @@ RED.deploy = (function() { RED.events.emit("deploy"); }).fail(function(xhr,textStatus,err) { RED.nodes.dirty(true); + $("#btn-deploy").removeClass("disabled"); if (xhr.status === 401) { RED.notify(RED._("deploy.deployFailed",{message:RED._("user.notAuthorized")}),"error"); } else if (xhr.status === 409) { @@ -651,8 +665,8 @@ RED.deploy = (function() { RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error"); } }).always(function() { - $("#btn-deploy-icon").removeClass('spinner'); - $("#btn-deploy-icon").addClass('fa-download'); + $(".deploy-button-content").css('opacity',1); + $(".deploy-button-spinner").hide(); }); } } diff --git a/editor/sass/header.scss b/editor/sass/header.scss index 780c211c4..51b12fd1f 100644 --- a/editor/sass/header.scss +++ b/editor/sass/header.scss @@ -111,6 +111,7 @@ span.logo { } #header .button-group > a { display: inline-block; + position: relative; float: left; line-height: 22px; font-size: 14px; @@ -133,6 +134,20 @@ span.logo { } } +.deploy-button-spinner { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + text-align: center; + + img { + opacity: 0.8; + height: 100%; + } +} + #btn-deploy { padding: 4px 12px; @@ -142,7 +157,7 @@ span.logo { background: $deployDisabledButton; color: #999 !important; - img { + .deploy-button-content>img { opacity: 0.3; } @@ -158,7 +173,7 @@ span.logo { } } - img { + .deploy-button-content>img { margin-right: 8px; } }