remove render event, add init event
This commit is contained in:
parent
8ed61d6b6b
commit
a33c337567
@ -4,6 +4,8 @@ X-editable changelog
|
|||||||
|
|
||||||
Version 1.2.0 wip
|
Version 1.2.0 wip
|
||||||
----------------------------
|
----------------------------
|
||||||
|
[enh] 'init' event was added due to removal of render event (vitalets)
|
||||||
|
[enh] 'render' event was removed, use 'display' callback instead (vitalets)
|
||||||
[enh] 'checklist' submit value as array, not comma separated string (vitalets)
|
[enh] 'checklist' submit value as array, not comma separated string (vitalets)
|
||||||
[enh] 'checklist' was refactored: options 'viewseparator', 'limit', 'limitText' are supressed by 'display' callback (vitalets)
|
[enh] 'checklist' was refactored: options 'viewseparator', 'limit', 'limitText' are supressed by 'display' callback (vitalets)
|
||||||
[enh] new option: 'display' callback. Makes far more flexible rendering value into element's text. (vitalets)
|
[enh] new option: 'display' callback. Makes far more flexible rendering value into element's text. (vitalets)
|
||||||
|
@ -515,5 +515,4 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
|
|
||||||
//error class attached to editable-error-block
|
//error class attached to editable-error-block
|
||||||
$.fn.editableform.errorBlockClass = 'editable-error';
|
$.fn.editableform.errorBlockClass = 'editable-error';
|
||||||
|
|
||||||
}(window.jQuery));
|
}(window.jQuery));
|
@ -20,9 +20,6 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
doAutotext,
|
doAutotext,
|
||||||
finalize;
|
finalize;
|
||||||
|
|
||||||
//initialization flag
|
|
||||||
this.isInit = true;
|
|
||||||
|
|
||||||
//editableContainer must be defined
|
//editableContainer must be defined
|
||||||
if(!$.fn.editableContainer) {
|
if(!$.fn.editableContainer) {
|
||||||
$.error('You must define $.fn.editableContainer via including corresponding file (e.g. editable-popover.js)');
|
$.error('You must define $.fn.editableContainer via including corresponding file (e.g. editable-popover.js)');
|
||||||
@ -71,13 +68,6 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
//stop propagation not required anymore because in document click handler it checks event target
|
//stop propagation not required anymore because in document click handler it checks event target
|
||||||
//e.stopPropagation();
|
//e.stopPropagation();
|
||||||
|
|
||||||
//mark event with special flag: it will not be processed in document click handler
|
|
||||||
/*
|
|
||||||
if(e.type === 'click' && e.target !== e.currentTarget) {
|
|
||||||
$(e.target).data('editable-element', e.currentTarget);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if(this.options.toggle === 'mouseenter') {
|
if(this.options.toggle === 'mouseenter') {
|
||||||
//for hover only show container
|
//for hover only show container
|
||||||
this.show();
|
this.show();
|
||||||
@ -102,20 +92,13 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
this.enable();
|
this.enable();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
Fired each time when element's text is rendered. Occurs on initialization and on each update of value.
|
Fired when element was initialized by editable method.
|
||||||
Can be used to customize display of value.
|
|
||||||
|
|
||||||
@event render
|
@event init
|
||||||
@param {Object} event event object
|
@param {Object} event event object
|
||||||
@param {Object} editable editable instance
|
@param {Object} editable editable instance
|
||||||
@example
|
|
||||||
$('#action').on('render', function(e, editable) {
|
|
||||||
var colors = {0: "gray", 1: "green", 2: "blue", 3: "red"};
|
|
||||||
$(this).css("color", colors[editable.value]);
|
|
||||||
});
|
|
||||||
**/
|
**/
|
||||||
this.$element.triggerHandler('render', this);
|
this.$element.triggerHandler('init', this);
|
||||||
this.isInit = false;
|
|
||||||
}, this));
|
}, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -361,7 +344,6 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
$.when(this.render())
|
$.when(this.render())
|
||||||
.then($.proxy(function() {
|
.then($.proxy(function() {
|
||||||
this.handleEmpty();
|
this.handleEmpty();
|
||||||
this.$element.triggerHandler('render', this);
|
|
||||||
}, this));
|
}, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user