rename cancelnochange into savenochange
This commit is contained in:
parent
19a6dabbae
commit
48a665c7f2
@ -18,7 +18,7 @@ Version 1.2.0 wip
|
||||
[enh] new option: 'display' callback. Makes far more flexible rendering value into element's text. (vitalets)
|
||||
[bug] fix typos (atrophic)
|
||||
[enh] all callbacks scope changed to element (vitalets)
|
||||
[enh] new option: 'cancelnochange' to cancel or submit value when it was not changed in form (vitalets)
|
||||
[enh] new option: 'savenochange' to save or cancel value when it was not changed in form (vitalets)
|
||||
[enh] composite pk can be defined as JSON in data-pk attribute (vitalets)
|
||||
[enh #30] new option 'sourceCache' true|false to disable cache for select (vitalets)
|
||||
[bug #34] inputclass span* broken with fluid bootstrap layout. Classes changed to 'input-*'. (vitalets)
|
||||
|
@ -181,7 +181,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
|
||||
//if value not changed --> cancel
|
||||
/*jslint eqeq: true*/
|
||||
if (this.options.cancelnochange && this.input.value2str(newValue) == this.input.value2str(this.value)) {
|
||||
if (!this.options.savenochange && this.input.value2str(newValue) == this.input.value2str(this.value)) {
|
||||
/*jslint eqeq: false*/
|
||||
this.cancel();
|
||||
return;
|
||||
@ -484,14 +484,14 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
**/
|
||||
scope: null,
|
||||
/**
|
||||
Whether to cancel or submit value when it was not changed.
|
||||
Whether to save or cancel value when it was not changed but form was submitted
|
||||
|
||||
@property cancelnochange
|
||||
@property savenochange
|
||||
@type boolean
|
||||
@default true
|
||||
@default false
|
||||
@since 1.2.0
|
||||
**/
|
||||
cancelnochange: true
|
||||
savenochange: false
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -97,6 +97,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
||||
@event init
|
||||
@param {Object} event event object
|
||||
@param {Object} editable editable instance
|
||||
@since 1.2.0
|
||||
**/
|
||||
this.$element.triggerHandler('init', this);
|
||||
}, this));
|
||||
@ -522,7 +523,6 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
||||
@default 'click'
|
||||
**/
|
||||
toggle: 'click',
|
||||
|
||||
/**
|
||||
Text shown when element is empty.
|
||||
|
||||
|
@ -390,10 +390,10 @@
|
||||
|
||||
});
|
||||
|
||||
asyncTest("cancelnochange: true", function () {
|
||||
asyncTest("savenochange: false", function () {
|
||||
var v = 'abc',
|
||||
e = $('<a href="#" data-type="text" data-pk="1" data-url="post-no.php" data-name="text1">'+v+'</a>').appendTo(fx).editable({
|
||||
cancelnochange: true
|
||||
savenochange: false
|
||||
}),
|
||||
req = 0;
|
||||
|
||||
@ -418,10 +418,10 @@
|
||||
}, timeout);
|
||||
});
|
||||
|
||||
asyncTest("cancelnochange: false", function () {
|
||||
asyncTest("savenochange: true", function () {
|
||||
var v = 'abc',
|
||||
e = $('<a href="#" data-type="text" data-pk="1" data-url="post-yes.php" data-name="text1">'+v+'</a>').appendTo(fx).editable({
|
||||
cancelnochange: false
|
||||
savenochange: true
|
||||
}),
|
||||
req = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user