name is not requred anymore fixes

This commit is contained in:
vitalets
2012-11-26 16:21:55 +04:00
parent bd64464a5d
commit 612ecc5e55
10 changed files with 29 additions and 32 deletions

@ -29,12 +29,8 @@ Makes editable any HTML element on the page. Applied as jQuery method.
return;
}
//name must be defined
//name
this.options.name = this.options.name || this.$element.attr('id');
if (!this.options.name) {
$.error('You must define name (or id) for Editable element');
return;
}
//create input of specified type. Input will be used for converting value, not in form
if(typeof $.fn.editableform.types[this.options.type] === 'function') {

@ -93,17 +93,16 @@ List - abstract class for inputs that have source option loaded from js array or
cache.callbacks = [];
cache.err_callbacks = [];
}
//loading sourceData from server
$.ajax({
url: this.options.source,
type: 'get',
cache: false,
data: {name: this.options.name},
data: this.options.name ? {name: this.options.name} : {},
dataType: 'json',
success: $.proxy(function (data) {
cache.loading = false;
// this.options.source = data;
this.sourceData = this.makeArray(data);
if($.isArray(this.sourceData)) {
this.doPrepend();