summaryrefslogtreecommitdiffstats
path: root/web/widget/combobox.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/widget/combobox.js')
-rw-r--r--web/widget/combobox.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/web/widget/combobox.js b/web/widget/combobox.js
deleted file mode 100644
index e1759ad..0000000
--- a/web/widget/combobox.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012-2014 Kaarle Ritvanen
- * See LICENSE file for license details
- */
-
-define(["aconf/widget/field", "jquery", "underscore"], function(Base, $, _) {
- return Base.extend({
- createEl: function() { return $("<select>"); },
-
- staticRender: function(value, meta) {
- return Base.staticRender.call(
- this,
- value ? _.findWhere(
- meta.choice, {value: value}
- )["ui-value"] : "",
- meta
- );
- },
-
- render: function(value, meta) {
- var el = this.field.empty();
-
- function opt(value, ui_value, selected) {
- var option = $("<option>").attr("value", value).text(ui_value);
- if (selected) option.attr("selected", "true");
- el.append(option);
- }
-
- if (!meta.required) opt("", "(none)", value == null);
-
- _.each(
- meta.choice,
- function(choice) {
- var selected = value == choice.value;
- if (choice.enabled || selected)
- opt(choice.value, choice["ui-value"], selected);
- }
- );
- }
- });
-});