diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/projectapp.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projectapp.js | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js index 8e3499a94c..94c24f4a56 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js +++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js | |||
@@ -128,7 +128,7 @@ projectApp.filter('timediff', function() { | |||
128 | 128 | ||
129 | 129 | ||
130 | // main controller for the project page | 130 | // main controller for the project page |
131 | projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $location, $cookies, $q, $sce, $anchorScroll, $animate, $sanitize) { | 131 | projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $location, $cookies, $cookieStore, $q, $sce, $anchorScroll, $animate, $sanitize) { |
132 | 132 | ||
133 | $scope.getSuggestions = function(type, currentValue) { | 133 | $scope.getSuggestions = function(type, currentValue) { |
134 | var deffered = $q.defer(); | 134 | var deffered = $q.defer(); |
@@ -572,9 +572,28 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc | |||
572 | }); | 572 | }); |
573 | 573 | ||
574 | _cmdExecuteWithParam("/layerimported", function (layer) { | 574 | _cmdExecuteWithParam("/layerimported", function (layer) { |
575 | $scope.displayAlert($scope.zone2alerts, | 575 | var imported = $cookieStore.get("layer-imported-alert"); |
576 | "You have imported <strong>" + layer + | 576 | var text; |
577 | "</strong> and added it to your project.", "alert-success"); | 577 | |
578 | if (!imported) | ||
579 | return; | ||
580 | |||
581 | if (imported.layersAdded.length == 0) { | ||
582 | text = "You have imported <strong>"+imported.name+ | ||
583 | "</strong> and added it to your project."; | ||
584 | } else { | ||
585 | text = "You have imported <strong>"+imported.name+ | ||
586 | "</strong> and added <strong>"+imported.layersAdded.length+ | ||
587 | "</strong> layers to your project. <strong>"+ | ||
588 | imported.layersAdded.join(", ")+"</strong>"; | ||
589 | } | ||
590 | |||
591 | $scope.displayAlert($scope.zone2alerts, text, "alert-info"); | ||
592 | |||
593 | // This doesn't work | ||
594 | $cookieStore.remove("layer-imported-alert"); | ||
595 | //use jquery plugin instead | ||
596 | $.removeCookie("layer-imported-alert", { path: "/"}); | ||
578 | }); | 597 | }); |
579 | 598 | ||
580 | _cmdExecuteWithParam("/targetbuild=", function (targets) { | 599 | _cmdExecuteWithParam("/targetbuild=", function (targets) { |