x-editable - adjusting the width of input field

后端 未结 6 988
天涯浪人
天涯浪人 2021-02-12 14:50

How do you adjust the input width of the popup

it doesn\'t seem like there is any option for it in

http://vitalets.github.io/x-editable/docs.html#text

6条回答
  •  攒了一身酷
    2021-02-12 15:50

    I made a modification in the code to control the width. Maybe not the elegant solution, but it works for me. Greetings! Consist in add a div as a guide to get width for the .editableform .form-control class

    Make BKP before make changes!

    bootstrap-editable.js On Line 14 add this code

    var GLOBAL_aux_id_ei = 0;
    

    On Line 181 add this code

    var w = $('#div-guide-'+GLOBAL_aux_id_ei).width();
    w = w -  ((w * 20) / 100);
    $('.editableform .form-control').css({"width":""+w+"px"});
    

    On Line 628 add this code and modify the existing code

    GLOBAL_aux_id_ei = GLOBAL_aux_id_ei + 1; 
    $.fn.editableform.template = '
    '+ '
    ' + '
    \n\
    \n\
    '+ '
    ' + '
    ' + '
    \n\ ';

    bootstrap-editable.css In .editable-container.editable-inline class on line 158

    width: 100%;
    

提交回复
热议问题