This commit is contained in:
BoHung Chiu 2022-09-05 09:28:51 +08:00
parent 2ba3253f67
commit 6e24bfc78c
3 changed files with 14 additions and 2 deletions

View File

@ -470,8 +470,14 @@ class AsksController < ApplicationController
var i0 = old_inputs.indexOf(v)
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),
old_ = old_controls.eq(i0).find('.controls').eq(0);
old_.clone().replaceAll(new_);
old_ = old_controls.eq(i0).find('.controls').eq(0),
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()

View File

@ -72,6 +72,9 @@
padding: 1em 0 0 0;
text-align: center;
}
.ask-question .controls > input[type="radio"]:not(:first-child) {
margin-left: 0.5em;
}
</style>
<%# 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" %>

View File

@ -46,6 +46,9 @@
padding: 1em 0 0 0;
text-align: center;
}
.ask-question .controls > input[type="radio"]:not(:first-child) {
margin-left: 0.5em;
}
</style>
<link href="/assets/custom_field.css" media="screen" rel="stylesheet">
<script src="/assets/validator"></script>