allow apply selector more than once, fix

This commit is contained in:
vitalets
2013-08-06 00:25:17 +04:00
parent 62da4f7cd3
commit db5b8fd070
3 changed files with 18 additions and 3 deletions

@ -621,6 +621,14 @@ Makes editable any HTML element on the page. Applied as jQuery method.
data = $this.data(datakey),
options = typeof option === 'object' && option;
//for delegated targets do not store `editable` object for element
//it's allows several different selectors.
//see: https://github.com/vitalets/x-editable/issues/312
if(options && options.selector) {
data = new Editable(this, options);
return;
}
if (!data) {
$this.data(datakey, (data = new Editable(this, options)));
}