[#4299] ticket:281 Refactored combobox widget a bit

Igor Bondarenko Igor Bondarenko 2013-03-01

Tim Van Steenburgh Tim Van Steenburgh 2013-03-22

changed Allura/allura/lib/widgets/form_fields.py
copied Allura/allura/lib/widgets/resources/js/project_user_combo.js -> Allura/allura/lib/widgets/resources/js/combobox.js
Allura/allura/lib/widgets/form_fields.py Diff Switch to side-by-side view
Loading...
Allura/allura/lib/widgets/resources/js/project_user_combo.js to Allura/allura/lib/widgets/resources/js/combobox.js
--- a/Allura/allura/lib/widgets/resources/js/project_user_combo.js
+++ b/Allura/allura/lib/widgets/resources/js/combobox.js
@@ -1,9 +1,15 @@
 (function($) {
   $.widget('ui.combobox', {
+
+    options: {
+      source_url: ''  // caller must provide this
+    },
+
     _create: function() {
       var input,
           that = this,
           wasOpen = false,
+          loaded = false,  // options list loaded with ajax already?
           select = this.element.hide(),
           selected = select.children(':selected'),
           value = selected.val() ? selected.text() : "",
@@ -75,7 +81,7 @@
 
       $('<a>')
         .attr('tabIndex', -1)
-        .attr('title', 'Show all users')
+        .attr('title', 'Show all options')
         .appendTo(wrapper)
         .button({
           icons: {
@@ -103,7 +109,3 @@
     }
   });
 })(jQuery);
-
-$(function() {
-  $('select.project-user-combobox').combobox();
-});