Commit ff20470d authored by Chenu Denis's avatar Chenu Denis

[fix] Bad position with 2.7X

parent d4a9126b
......@@ -2,7 +2,7 @@
border:0 none;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.2) inset;
}
.ui-autocomplete{z-index:2}
.ui-autocomplete{z-index:2;position:absolute !important}
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
......
function autoCpVille(qId,options){
var answerLibels=$("#question"+qId+" input[name*='X"+qId+options.answerLibel+"']");
console.log(answerLibels.length);
if(answerLibels.length>=1)
{
$(answerLibels).keypress(function(e) {
......@@ -15,7 +14,6 @@ function autoCpVille(qId,options){
$(answerLibels).each(function(){
// Find final part
var thisid=$(this).attr("id");
console.log(thisid);
var n=thisid.indexOf('X'+qId+options.answerLibel);
var endLibel=$(this).attr("id").substring($(this).attr("id").indexOf(baseLibel)+baseLibelLength);
// Set the options for each lines
......@@ -43,10 +41,15 @@ function autoCpVille(qId,options){
$(value).find("input[type=text]").prop("readonly",true).addClass("readonly");
});
var parent=$(this).parent();
$(parent).css("position","relative");
$(this).autocomplete({
minLength: 1,
appendTo: parent,
position: { my : "left top", at: "left bottom", collision: "flipfit" },
position: {
my : "left top",
at: "left bottom",
collision: "flipfit"
},
source: function(request, response) {
$.ajax({
url: options.jsonurl,
......
......@@ -248,8 +248,9 @@ class cpVille extends \ls\pluginmanager\PluginBase {
$oCriteria->addNotInCondition('title',$aThisSubQ);
$oCriteria->compare('parent_qid',$iQid);
$iCountOtherQuestion=Question::model()->count($oCriteria);
if(!$iCountOtherQuestion)
if(!$iCountOtherQuestion) {
$oEvent->set('man_message',"<strong><br /><span class='errormandatory'>".gT('This question is mandatory').". </span></strong>\n");
}
}
$assetUrl=Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets/');
Yii::app()->clientScript->registerScriptFile($assetUrl.'/cpville.js');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment