Better handling of multiple selected read-only accounts

This commit is contained in:
Nathan Gray 2012-04-16 23:08:28 +00:00
parent 61f5cbbe55
commit 4407942ca6
3 changed files with 25 additions and 2 deletions

View File

@ -24,7 +24,7 @@
* It extends et2_link to avoid needing the whole user list on the client. * It extends et2_link to avoid needing the whole user list on the client.
* Instead, it just asks for the names of the ones needed, as needed. * Instead, it just asks for the names of the ones needed, as needed.
*/ */
var et2_selectAccount_ro = et2_link.extend([et2_IDetachedDOM], { var et2_selectAccount_ro = et2_link_string.extend([et2_IDetachedDOM], {
init: function(_parent, options) { init: function(_parent, options) {
/** /**
@ -42,7 +42,14 @@ var et2_selectAccount_ro = et2_link.extend([et2_IDetachedDOM], {
this.options.application = 'home-accounts'; this.options.application = 'home-accounts';
// Don't make it look like a link though // Don't make it look like a link though
this.link.removeClass("et2_link"); this.list.removeClass("et2_link_string").addClass("et2_selectbox");
},
set_value: function(_value) {
this._super.apply(this, arguments);
// Don't make it look like a link though
jQuery('li',this.list).removeClass("et2_link et2_link_string");
} }
}); });
et2_register_widget(et2_selectAccount_ro, ["select-account_ro"]); et2_register_widget(et2_selectAccount_ro, ["select-account_ro"]);

View File

@ -497,6 +497,11 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
this.setDOMNode(this.span[0]); this.setDOMNode(this.span[0]);
}, },
// Handle read-only multiselects in the same way
createMultiSelect: function() {
this.createInputWidget();
},
loadFromXML: function(_node) { loadFromXML: function(_node) {
// Read the option-tags // Read the option-tags
var options = et2_directChildrenByTagName(_node, "options"); var options = et2_directChildrenByTagName(_node, "options");

View File

@ -213,6 +213,17 @@ button.et2_button_text:focus {
height: 1.8em; height: 1.8em;
} }
/* Read-only multi-select */
ul.et2_selectbox {
margin: 0px;
padding: 0px;
}
.et2_selectbox li {
text-decoration: none;
list-style-image: none;
list-style-type: none;
}
/** /**
* Date / Time widgets * Date / Time widgets
*/ */