mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Add admin field application
This commit is contained in:

committed by
Romain Neutron

parent
7199d38ab3
commit
05dc3659af
29
www/scripts/apps/admin/fields/views/dcField.js
Normal file
29
www/scripts/apps/admin/fields/views/dcField.js
Normal file
@@ -0,0 +1,29 @@
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'i18n'
|
||||
], function( _, Backbone, i18n, bootstrap) {
|
||||
var DcFieldsView = Backbone.View.extend({
|
||||
tagName: "div",
|
||||
className: "input-append",
|
||||
events: {
|
||||
"change select": "onChange"
|
||||
},
|
||||
render: function() {
|
||||
var template = _.template($("#dc_fields_template").html(), {
|
||||
dces_elements: this.collection.toJSON()
|
||||
});
|
||||
|
||||
this.$el.html(template);
|
||||
|
||||
return this;
|
||||
},
|
||||
onChange: function(e) {
|
||||
var index = $(e.target)[0].selectedIndex;
|
||||
this.$el.closest('table').find('.dces-help-block').empty().append(this.collection.at(index).get('definition'));
|
||||
}
|
||||
});
|
||||
|
||||
return DcFieldsView;
|
||||
});
|
||||
|
Reference in New Issue
Block a user