Better fix.

see #179
This commit is contained in:
Antoine Nguyen
2011-12-14 17:09:40 +01:00
parent 7a52d4d738
commit 7d89e85db9
3 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -8,13 +8,13 @@ body {
div.row {
clear: both;
padding-top: 10px;
padding-left: 20px;
}
div.row label {
float: left;
width: 120px;
padding: 3px 0;
padding-left: 20px;
}
input {
+7 -2
View File
@@ -3,7 +3,8 @@ var DynamicTextInput = new Class({
Implements: [Options],
options: {
parentContainer: null
parentContainer: null,
containerLevel: 1
},
initialize: function(targets, options) {
@@ -68,7 +69,11 @@ var DynamicTextInput = new Class({
"margin-top": "2px"
});
if (!this.options.parentContainer) {
field[0].inject(this.target.getParent(), "after");
var container = this.target;
for (var i = 0; i < this.options.containerLevel; i++) {
container = container.getParent()
}
field[0].inject(container, "after");
} else {
field[0].inject(this.options.parentContainer);
}
+3 -1
View File
@@ -9,7 +9,9 @@
<script type="text/javascript" src="{{ MEDIA_URL }}js/Autocompleter.Request.js"></script>
<script type="text/javascript">
function init_form() {
var dti = new DynamicTextInput($$("input[name=targets]"));
var dti = new DynamicTextInput($$("input[name=targets]"), {
containerLevel: 2
});
new Autocompleter.Request.JSON("id_targets",
"{% url admin.views.mailboxes_search %}", {