mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 04:53:26 +00:00
Add global register feature
Tweak admin field app Fix typo Tweaks Fix typo
This commit is contained in:

committed by
Romain Neutron

parent
9a9235a15e
commit
0539db7598
@@ -1,26 +1,31 @@
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'i18n'
|
||||
], function( _, Backbone, i18n, bootstrap) {
|
||||
"jquery",
|
||||
"underscore",
|
||||
"backbone",
|
||||
"i18n"
|
||||
], function($, _, Backbone, i18n, bootstrap) {
|
||||
var DcFieldsView = Backbone.View.extend({
|
||||
tagName: "div",
|
||||
className: "input-append",
|
||||
events: {
|
||||
"change select": "selectChangedAction"
|
||||
initialize : function (options) {
|
||||
this.field = options.field;
|
||||
},
|
||||
render: function() {
|
||||
var template = _.template($("#dc_fields_template").html(), {
|
||||
dces_elements: this.collection.toJSON()
|
||||
dces_elements: this.collection.toJSON(),
|
||||
field: this.field.toJSON()
|
||||
});
|
||||
|
||||
this.$el.html(template);
|
||||
|
||||
var index = $("#dces-element", AdminFieldApp.$rightBlock)[0].selectedIndex - 1;
|
||||
if (index > 0 ) {
|
||||
$(".dces-help-block", AdminFieldApp.$rightBlock).html(
|
||||
this.collection.at(index).get("definition")
|
||||
);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
selectChangedAction: function(e) {
|
||||
var index = $(e.target)[0].selectedIndex;
|
||||
this.$el.closest('table').find('.dces-help-block').empty().append(this.collection.at(index).get('definition'));
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user