diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projectapp.js | 22 |
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); + }); |