From a4cfca604b2c5ab35baf69c2070afa0087842b68 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 21 Apr 2015 11:38:03 +0100 Subject: 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 Signed-off-by: Richard Purdie --- .../lib/toaster/toastergui/static/js/projectapp.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/toaster/toastergui/static') 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: " + $scope.machine.name + "", "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); + }); -- cgit v1.2.3-54-g00ecf