long list widgets now clickable
parent
720b73939f
commit
9a19207f86
|
@ -122,9 +122,23 @@ var ListWidgetChildView = Backbone.View.extend({
|
|||
render:function () {
|
||||
this.$el.html(this.template(this.model.toJSON()));
|
||||
|
||||
$('.item-full', this.el).hide();
|
||||
|
||||
if (this.model.get('item').length > 30) {
|
||||
this.$el.tooltip({title:this.model.get('item')});
|
||||
this.$el.tooltip({title:$.t('admin.list-widget.tooltip')});
|
||||
|
||||
var _self = this;
|
||||
|
||||
$(this.el).click(function(event) {
|
||||
event.preventDefault();
|
||||
$('.item-short', _self.el).hide();
|
||||
$('.item-full', _self.el).show();
|
||||
_self.$el.tooltip('destroy');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(this.el).i18n();
|
||||
return this;
|
||||
}
|
||||
|
@ -199,6 +213,11 @@ var ListWidgetView = Backbone.View.extend({
|
|||
if (this.options.autocomplete) {
|
||||
$('input', this.$el).typeahead({source:this.options.autocomplete});
|
||||
}
|
||||
|
||||
// render toggleable options
|
||||
if (this.options.toggles) {
|
||||
|
||||
}
|
||||
|
||||
_self = this;
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
},
|
||||
"home": "Home",
|
||||
"list-widget": {
|
||||
"empty": "There are no items in this list."
|
||||
"empty": "There are no items in this list.",
|
||||
"tooltip": "Click to display full value."
|
||||
},
|
||||
"manage-blacklist": "Manage Blacklisted Clients",
|
||||
"self-service-client": "Self-service Client Registration",
|
||||
|
|
|
@ -28,7 +28,10 @@
|
|||
<!-- list widget -->
|
||||
|
||||
<script type="text/html" id="tmpl-list-widget-child">
|
||||
<td><%-(item.length > 30) ? item.substr(0,27) + '...' : item %></td>
|
||||
<td>
|
||||
<span class="item-short"><%-(item.length > 30) ? item.substr(0,27) + '...' : item %></span>
|
||||
<input type="text" readonly style="cursor: text" class="item-full input-xxlarge" value="<%- item %>" />
|
||||
</td>
|
||||
<td><a class="btn btn-small btn-delete-list-item" href="#"><i class="icon-minus-sign"></i></a></td>
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue