summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/layers.html
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/layers.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/layers.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/layers.html b/bitbake/lib/toaster/toastergui/templates/layers.html
index db34fe4818..8cb079d0a3 100644
--- a/bitbake/lib/toaster/toastergui/templates/layers.html
+++ b/bitbake/lib/toaster/toastergui/templates/layers.html
@@ -120,10 +120,21 @@ function _makeXHREditCall(data, onsuccess, onfail) {
120 }); 120 });
121} 121}
122 122
123function updateLayerCountLabels (amount) {
124 /* Update the filter labels */
125 var countLabel = $("#projectlayer__project\\:{{project.id}}_count");
126 countLabel.text(Number(countLabel.text())+amount);
127
128 var countLabelRemaining = $("#projectlayer__project\\:NOT{{project.id}}_count");
129 countLabelRemaining.text(Number(countLabelRemaining.text())-amount);
130}
131
123 132
124function layerDel(layerId, layerName, layerURL) { 133function layerDel(layerId, layerName, layerURL) {
125 tooltipUpdateText = "1 layer deleted"; 134 tooltipUpdateText = "1 layer deleted";
126 _makeXHREditCall({ 'layerDel': layerId }, function () { 135 _makeXHREditCall({ 'layerDel': layerId }, function () {
136 updateLayerCountLabels(-1);
137
127 show_alert("You have deleted <strong>1</strong> layer from <a href=\"{% url 'project' project.id%}\">{{project.name}}</a>: <a href=\""+layerURL+"\">" + layerName +"</a>"); 138 show_alert("You have deleted <strong>1</strong> layer from <a href=\"{% url 'project' project.id%}\">{{project.name}}</a>: <a href=\""+layerURL+"\">" + layerName +"</a>");
128 }); 139 });
129} 140}
@@ -187,6 +198,8 @@ function layerAdd(layerId, layerName, layerURL) {
187 if (_data.error != "ok") { 198 if (_data.error != "ok") {
188 alert(_data.error); 199 alert(_data.error);
189 } else { 200 } else {
201 updateLayerCountLabels(_data.list.length+1);
202
190 if (_data.list.length > 0) { 203 if (_data.list.length > 0) {
191 show_dependencies_modal(layerId, layerName, layerURL, _data.list); 204 show_dependencies_modal(layerId, layerName, layerURL, _data.list);
192 } 205 }