diff options
author | Michael Wood <michael.g.wood@intel.com> | 2014-10-31 16:18:04 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-12 17:04:49 +0000 |
commit | 6f0496ef557cddda8fc8d71b414aa70e72e91aa8 (patch) | |
tree | d7a3beb6dd4631e50ccc2d4f422ffedff22c95f6 /bitbake/lib/toaster/toastergui/templates/targets.html | |
parent | 6cfd8aa148bbcbc268bc3cd9da8a30145e72f066 (diff) | |
download | poky-6f0496ef557cddda8fc8d71b414aa70e72e91aa8.tar.gz |
bitbake: toaster: Update filter count labels when Add/Remove layers
When the user has added/removed a layer but no page reload/requery has
happened we need to update the filter count labels client side.
[YOCTO #6861]
(Bitbake rev: d17e8425de6c609394b9a029afa2dcb455df0b3c)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/targets.html')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/targets.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/targets.html b/bitbake/lib/toaster/toastergui/templates/targets.html index 32a644a743..8776a5d548 100644 --- a/bitbake/lib/toaster/toastergui/templates/targets.html +++ b/bitbake/lib/toaster/toastergui/templates/targets.html | |||
@@ -182,6 +182,14 @@ function show_dependencies_modal(layerId, layerName, layerURL, dependencies) { | |||
182 | $('#dependencies_modal').modal('show'); | 182 | $('#dependencies_modal').modal('show'); |
183 | } | 183 | } |
184 | 184 | ||
185 | function updateLayerCountLabels (amount) { | ||
186 | /* Update the filter labels */ | ||
187 | var countLabel = $("#layer_version__projectlayer__project\\:{{project.id}}_count"); | ||
188 | countLabel.text(Number(countLabel.text())+amount); | ||
189 | |||
190 | var countLabelRemaining = $("#layer_version__projectlayer__project\\:NOT{{project.id}}_count"); | ||
191 | countLabelRemaining.text(Number(countLabelRemaining.text())-amount); | ||
192 | } | ||
185 | 193 | ||
186 | var pressedButton = undefined; | 194 | var pressedButton = undefined; |
187 | 195 | ||
@@ -194,6 +202,8 @@ function layerAdd(layerId, layerName, layerURL, pressedButtonId) { | |||
194 | if (_data.error != "ok") { | 202 | if (_data.error != "ok") { |
195 | alert(_data.error); | 203 | alert(_data.error); |
196 | } else { | 204 | } else { |
205 | updateLayerCountLabels(_data.list.length+1); | ||
206 | |||
197 | if (_data.list.length > 0) { | 207 | if (_data.list.length > 0) { |
198 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); | 208 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); |
199 | } | 209 | } |