incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [09/15] git commit: [#6893] ticket:507 added current assigned user to input list
Date Mon, 03 Feb 2014 22:53:35 GMT
[#6893] ticket:507 added current assigned user to input list


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/208280fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/208280fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/208280fe

Branch: refs/heads/cj/7085
Commit: 208280fe90e28d57667076c27d62499a1ca7e740
Parents: 8ba6c0a
Author: Sergey Gromovoy <sgromovoy@gmail.com>
Authored: Sat Jan 25 18:56:27 2014 +0200
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Jan 29 22:11:17 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/resources/js/combobox.js | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/208280fe/Allura/allura/lib/widgets/resources/js/combobox.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/combobox.js b/Allura/allura/lib/widgets/resources/js/combobox.js
index 6203e3b..9a20601 100644
--- a/Allura/allura/lib/widgets/resources/js/combobox.js
+++ b/Allura/allura/lib/widgets/resources/js/combobox.js
@@ -39,15 +39,21 @@
       function populateSelect(data) {
         select.children('option').remove();
         $('<option></option>').val('').appendTo(select);
+        var cur_user_in_data = false;
         for (var i = 0; i < data.options.length; i++) {
           var label = data.options[i].label,
               value = data.options[i].value;
           var option = $('<option>' + label + '</option>').val(value);
           if (selected.val() === value) {
             option.attr('selected', 'selected');  // select initial value, if any
+            cur_user_in_data = true;
           }
           option.appendTo(select);
         }
+        if (!cur_user_in_data) {
+          selected.attr('selected', 'selected');
+          selected.appendTo(select);
+        }
         loaded = true;
         if (wasOpen) {
           input.autocomplete('search', input.val());  // trigger search to re-render options


Mime
View raw message