long list widgets now clickable
parent
720b73939f
commit
9a19207f86
|
@ -122,9 +122,23 @@ var ListWidgetChildView = Backbone.View.extend({
|
||||||
render:function () {
|
render:function () {
|
||||||
this.$el.html(this.template(this.model.toJSON()));
|
this.$el.html(this.template(this.model.toJSON()));
|
||||||
|
|
||||||
|
$('.item-full', this.el).hide();
|
||||||
|
|
||||||
if (this.model.get('item').length > 30) {
|
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();
|
$(this.el).i18n();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -200,6 +214,11 @@ var ListWidgetView = Backbone.View.extend({
|
||||||
$('input', this.$el).typeahead({source:this.options.autocomplete});
|
$('input', this.$el).typeahead({source:this.options.autocomplete});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// render toggleable options
|
||||||
|
if (this.options.toggles) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
_self = this;
|
_self = this;
|
||||||
|
|
||||||
if (_.size(this.collection.models) == 0) {
|
if (_.size(this.collection.models) == 0) {
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
},
|
},
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"list-widget": {
|
"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",
|
"manage-blacklist": "Manage Blacklisted Clients",
|
||||||
"self-service-client": "Self-service Client Registration",
|
"self-service-client": "Self-service Client Registration",
|
||||||
|
|
|
@ -28,7 +28,10 @@
|
||||||
<!-- list widget -->
|
<!-- list widget -->
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-list-widget-child">
|
<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>
|
<td><a class="btn btn-small btn-delete-list-item" href="#"><i class="icon-minus-sign"></i></a></td>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue