X-editable 防止输入框在聚焦时关闭的默认行为

X-editable prevent the default behavior of input box close on focus out

当焦点更改为其他内容时,如何防止关闭 x 可编辑输入框的默认行为?。

我的要求是保持输入框打开,直到点击对勾或十字按钮。

我相信您正在寻找 {onblur: "ignore"}

来自documentation:

Action when the user clicks outside the container. Can be cancel|submit|ignore.
Setting ignore allows having several containers open.

请参阅this fiddle,或下面的演示。

$(function() {

  $.fn.editable.defaults.mode = 'inline';
  $('#publicname-change').editable({ onblur:"ignore"})

});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script src="http://vitalets.github.com/x-editable/assets/x-editable/bootstrap-editable/js/bootstrap-editable.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link href="http://vitalets.github.com/x-editable/assets/x-editable/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet"/>


<div class="control-group control-group-inline">
  <div class="controls">
    <a href="#" id="publicname-change" class="editable editable-click inline-input">Mr.Rohith</a>
  </div>
</div>