aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-04-21 11:38:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-08 17:42:06 +0100
commita4cfca604b2c5ab35baf69c2070afa0087842b68 (patch)
tree9343dc50aba81066a241b76e7ba04274dbb75811
parented26a06a07a75c8039f2a9b251b350331c7474aa (diff)
downloadopenembedded-core-contrib-a4cfca604b2c5ab35baf69c2070afa0087842b68.tar.gz
bitbake: toaster: projectapp Implement machine select command
Use the project page to select the machine rather than setting it and then redirecting to the project page. This will also avoid having to have a special handler in the machines page it's self. (Bitbake rev: 9847e04d86063e4464afb402cb1352243b51f504) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectapp.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
index d52ba73f3d..1fd4a54f57 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
@@ -424,6 +424,24 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
$scope.layerAddId = item.id;
};
+ $scope.machineSelect = function (machineName) {
+ $scope._makeXHRCall({
+ method: "POST", url: $scope.urls.xhr_edit,
+ data: {
+ machineName: machineName,
+ }
+ }).then(function () {
+ $scope.machine.name = machineName;
+
+ $scope.displayAlert($scope.zone2alerts, "You have changed the machine to: <strong>" + $scope.machine.name + "</strong>", "alert-info");
+ var machineDistro = angular.element("#machine-distro");
+
+ angular.element("html, body").animate({ scrollTop: machineDistro.position().top }, 700).promise().done(function() {
+ $animate.addClass(machineDistro, "machines-highlight");
+ });
+ });
+ };
+
$scope.layerAddById = function (id) {
$scope.layerAddId = id;
@@ -752,7 +770,9 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
_cmdExecuteWithParam("/machineselect=", function (machine) {
$scope.machineName = machine;
- $scope.toggle('#select-machine');
+ $scope.machine.name = machine;
+ $scope.machineSelect(machine);
+
});