From ecb58275e30f215143c57bdf96094103c8fda7ba Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 16 Sep 2011 12:02:12 -0500 Subject: [PATCH] Use editable combobox for service type. The service type field in the service adder dialog has been modified to use an editable combobox. Ticket #1633. --- install/ui/service.js | 42 +++++++++++++++--------------------------- install/ui/widget.js | 34 +++++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/install/ui/service.js b/install/ui/service.js index 3a7920c00..f8e95f897 100644 --- a/install/ui/service.js +++ b/install/ui/service.js @@ -77,31 +77,6 @@ IPA.entity_factories.service = function() { }; -IPA.service_select_widget = function(spec) { - - var that = IPA.text_widget(spec); - var known_services = ["", "cifs", "DNS", "ftp", "HTTP","imap", "ldap", - "libvirt","nfs","qpidd","smtp"]; - - that.parent_create = that.create; - - that.create = function(container) { - - var select_widget = $('', { name: 'list', - size: that.list_size, + size: that.size, style: 'width: 100%', change: function() { var value = $('option:selected', that.list).val(); @@ -1720,7 +1721,30 @@ IPA.combobox_widget = function(spec) { return that.list_container.css('visibility') == 'visible'; }; - that.search = function(filter) { + that.search = function(filter, on_success, on_error) { + + that.remove_options(); + + if (that.empty_option) { + that.create_option(); + } + + for (var i=0; i', { - text: text, + text: label, value: value }).appendTo(that.list); };