Fix bug.
This commit is contained in:
parent
2ba3253f67
commit
6e24bfc78c
|
@ -470,8 +470,14 @@ class AsksController < ApplicationController
|
||||||
var i0 = old_inputs.indexOf(v)
|
var i0 = old_inputs.indexOf(v)
|
||||||
if (i0 != -1 && new_controls.eq(i).find('select#ask_question_category_id').length==0){
|
if (i0 != -1 && new_controls.eq(i).find('select#ask_question_category_id').length==0){
|
||||||
var new_ = new_controls.eq(i).find('.controls').eq(0),
|
var new_ = new_controls.eq(i).find('.controls').eq(0),
|
||||||
old_ = old_controls.eq(i0).find('.controls').eq(0);
|
old_ = old_controls.eq(i0).find('.controls').eq(0),
|
||||||
old_.clone().replaceAll(new_);
|
new_input = new_.find('input, select'),
|
||||||
|
old_input = old_.find('input, select');
|
||||||
|
if(new_input.length != 0 && old_input.length != 0){
|
||||||
|
if(new_input.length == old_input.length){
|
||||||
|
old_.replaceAll(new_);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
self.parents('.ask-question').eq(0).find('form').hide()
|
self.parents('.ask-question').eq(0).find('form').hide()
|
||||||
|
|
|
@ -72,6 +72,9 @@
|
||||||
padding: 1em 0 0 0;
|
padding: 1em 0 0 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.ask-question .controls > input[type="radio"]:not(:first-child) {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<%# javascript_include_tag "/assets/lib/jquery-ui-1.12.1/jquery-ui.min" %>
|
<%# javascript_include_tag "/assets/lib/jquery-ui-1.12.1/jquery-ui.min" %>
|
||||||
<%# stylesheet_link_tag "/assets/lib/jquery-ui-1.12.1/jquery-ui.min" %>
|
<%# stylesheet_link_tag "/assets/lib/jquery-ui-1.12.1/jquery-ui.min" %>
|
||||||
|
|
|
@ -46,6 +46,9 @@
|
||||||
padding: 1em 0 0 0;
|
padding: 1em 0 0 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.ask-question .controls > input[type="radio"]:not(:first-child) {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<link href="/assets/custom_field.css" media="screen" rel="stylesheet">
|
<link href="/assets/custom_field.css" media="screen" rel="stylesheet">
|
||||||
<script src="/assets/validator"></script>
|
<script src="/assets/validator"></script>
|
||||||
|
|
Loading…
Reference in New Issue