summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-07-31 15:09:23 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 11:26:13 +0100
commit829fe326215b556ee5ca032ad3a8ff4c59a5f4c0 (patch)
treeaecb763e8dc439f3a999b5a721b5e0b0dc217126 /bitbake/lib/toaster/toastergui/static
parentc76137e25b285f3f31c162b888cf14c8999ead07 (diff)
downloadpoky-829fe326215b556ee5ca032ad3a8ff4c59a5f4c0.tar.gz
bitbake: toastergui: project page Add inline project name change feature
This feature allows the project name to be changed from where ever it is displayed in the project pages. [YOCTO #7329] (Bitbake rev: 81cb1cd1aa900f29a25d14dce93d301cd6b6fdb7) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/base.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js
index 09c3ef137b..f25336110a 100644
--- a/bitbake/lib/toaster/toastergui/static/js/base.js
+++ b/bitbake/lib/toaster/toastergui/static/js/base.js
@@ -5,6 +5,10 @@ function basePageInit(ctx) {
5 var newBuildButton = $("#new-build-button"); 5 var newBuildButton = $("#new-build-button");
6 var newBuildTargetInput; 6 var newBuildTargetInput;
7 var newBuildTargetBuildBtn; 7 var newBuildTargetBuildBtn;
8 var projectNameForm = $("#project-name-change-form");
9 var projectName = $("#project-name");
10 var projectNameFormToggle = $("#project-change-form-toggle");
11 var projectNameChangeCancel = $("#project-name-change-cancel");
8 12
9 /* initially the current project is used unless overridden by the new build 13 /* initially the current project is used unless overridden by the new build
10 * button in top right nav 14 * button in top right nav
@@ -16,6 +20,31 @@ function basePageInit(ctx) {
16 var newBuildProjectInput = $("#new-build-button #project-name-input"); 20 var newBuildProjectInput = $("#new-build-button #project-name-input");
17 var newBuildProjectSaveBtn = $("#new-build-button #save-project-button"); 21 var newBuildProjectSaveBtn = $("#new-build-button #save-project-button");
18 22
23 /* Project name change functionality */
24 projectNameFormToggle.click(function(e){
25 e.preventDefault();
26
27 $(this).add(projectName).hide();
28 projectNameForm.fadeIn();
29 });
30
31 projectNameChangeCancel.click(function(e){
32 e.preventDefault();
33
34 projectNameForm.hide();
35 projectName.add(projectNameFormToggle).fadeIn();
36 });
37
38 $("#project-name-change-btn").click(function(e){
39 var newProjectName = $("#project-name-change-input").val();
40
41 libtoaster.editCurrentProject({ projectName: newProjectName },function (){
42
43 projectName.text(newProjectName);
44 libtoaster.ctx.projectName = newProjectName;
45 projectNameChangeCancel.click();
46 });
47 });
19 48
20 _checkProjectBuildable(); 49 _checkProjectBuildable();
21 50