diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/base.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/base.js | 29 |
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 | ||