aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/default.css1
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/importlayer.js29
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/tests/test.js2
3 files changed, 24 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css
index ff24e8c1ab..5cd7e211a0 100644
--- a/bitbake/lib/toaster/toastergui/static/css/default.css
+++ b/bitbake/lib/toaster/toastergui/static/css/default.css
@@ -210,7 +210,6 @@ fieldset.fields-apart-from-layer-name { margin-top: 20px; }
#import-layer-name,
#layer-subdir { width: 20%; }
#layer-git-repo-url { width: 40%; }
-#layer-git-ref { width: 32%; }
#local-dir-path { width: 45%; }
#layer-dependency { width: 16em; }
#layer-deps-list { margin-top: 0; }
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
index 4784c657f5..b3f094e69b 100644
--- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js
+++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -45,7 +45,7 @@ function importLayerPageInit (ctx) {
function(layer) {
if (layer.results.length > 0) {
currentLayerDepSelection = layer.results[0];
- layerDepBtn.click();
+ layerDepBtn.click();
}
});
@@ -333,19 +333,36 @@ function importLayerPageInit (ctx) {
check_form();
});
- /* Have a guess at the layer name */
+ /* Setup 'blank' typeahead */
+ libtoaster.makeTypeahead(gitRefInput,
+ ctx.xhrGitRevTypeAheadUrl,
+ { git_url: null }, function(){});
+
+
vcsURLInput.focusout(function (){
+ if (!$(this).val())
+ return;
+
/* If we a layer name specified don't overwrite it or if there isn't a
* url typed in yet return
*/
- if (layerNameInput.val() || !$(this).val())
- return;
-
- if ($(this).val().search("/")){
+ if (!layerNameInput.val() && $(this).val().search("/")){
var urlPts = $(this).val().split("/");
+ /* Add a suggestion of the layer name */
var suggestion = urlPts[urlPts.length-1].replace(".git","");
layerNameInput.val(suggestion);
}
+
+ /* Now actually setup the typeahead properly with the git url entered */
+ gitRefInput._typeahead('destroy');
+
+ libtoaster.makeTypeahead(gitRefInput,
+ ctx.xhrGitRevTypeAheadUrl,
+ { git_url: $(this).val() },
+ function(selected){
+ gitRefInput._typeahead("close");
+ });
+
});
function radioDisplay() {
diff --git a/bitbake/lib/toaster/toastergui/static/js/tests/test.js b/bitbake/lib/toaster/toastergui/static/js/tests/test.js
index d7953de447..f3bf8d7733 100644
--- a/bitbake/lib/toaster/toastergui/static/js/tests/test.js
+++ b/bitbake/lib/toaster/toastergui/static/js/tests/test.js
@@ -144,7 +144,7 @@ QUnit.test("Make typeaheads", function(assert){
/* Page init functions */
QUnit.test("Import layer page init", function(assert){
- assert.throws(importLayerPageInit());
+ assert.throws(importLayerPageInit({ xhrGitRevTypeAheadUrl: "url" }));
});
QUnit.test("Project page init", function(assert){