set autotext = always if display is function

This commit is contained in:
vitalets
2013-06-13 10:36:41 +04:00
parent 655aeebdc2
commit 79c06725ba
4 changed files with 25 additions and 8 deletions

@ -81,6 +81,12 @@ Makes editable any HTML element on the page. Applied as jQuery method.
this.$element.attr('tabindex', -1); //do not stop focus on element when toggled manually
}
//if display is function it's far more convinient to have autotext = always to render correctly on init
//see https://github.com/vitalets/x-editable-yii/issues/34
if(typeof this.options.display === 'function') {
this.options.autotext = 'always'
}
//check conditions for autotext:
switch(this.options.autotext) {
case 'always':