From 10ffe1b8cc1fad3fb093fcf127b530011ecd3de4 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Fri, 31 Jul 2015 15:09:17 +0300 Subject: [PATCH] bitbake: toastergui: base Use removeAttr / attr Use removeAttr and attr calls to enable and disable the build button and build input field. (Bitbake rev: c3753948bd00c3498ca3e76cb218eb6cf423c3e3) Signed-off-by: Michael Wood Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/base.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js index 0fb1f8b6bf..c99f8cdc54 100644 --- a/bitbake/lib/toaster/toastergui/static/js/base.js +++ b/bitbake/lib/toaster/toastergui/static/js/base.js @@ -62,7 +62,9 @@ function basePageInit(ctx) { libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function (item) { /* successfully selected a target */ selectedTarget = item; - }); + newBuildTargetBuildBtn.removeAttr("disabled"); + }); + } newBuildTargetInput.on('input', function () { if ($(this).val().length === 0) { @@ -105,8 +107,8 @@ function basePageInit(ctx) { $("#new-build-button .alert").hide(); /* we can build this project; enable input fields */ - newBuildTargetInput.prop("disabled", false); - newBuildTargetBuildBtn.prop("disabled", false); + newBuildTargetInput.removeAttr("disabled"); + newBuildTargetBuildBtn.removeAttr("disabled"); } }, null); } @@ -144,13 +146,13 @@ function basePageInit(ctx) { /* Update the typeahead project_id paramater */ _checkProjectBuildable(); - newBuildTargetInput.prop("disabled", false); - newBuildTargetBuildBtn.prop("disabled", false); + newBuildTargetInput.removeAttr("disabled"); /* Update the typeahead to use the new selectedProject */ libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function (item) { /* successfully selected a target */ selectedTarget = item; + newBuildTargetBuildBtn.removeAttr("disabled"); }); newBuildTargetInput.val("");