refactor containers: same render logic, fix tests
This commit is contained in:
src
containers
editable-form
element
test/unit
@ -47,25 +47,23 @@
|
||||
},
|
||||
|
||||
tip: function() {
|
||||
return this.container()._find(this.container().element);
|
||||
return this.container() ? this.container()._find(this.container().element) : null;
|
||||
},
|
||||
|
||||
innerShow: function() {
|
||||
this.call('open');
|
||||
this.tip().addClass('editable-container');
|
||||
|
||||
this.initForm();
|
||||
this.tip().find(this.innerCss)
|
||||
.empty()
|
||||
.append($('<label>').text(this.options.title || this.$element.data( "ui-tooltip-title") || this.$element.data( "originalTitle")))
|
||||
.append(this.$form);
|
||||
this.$form.editableform('render');
|
||||
var label = this.options.title || this.$element.data( "ui-tooltip-title") || this.$element.data( "originalTitle");
|
||||
this.tip().find(this.innerCss).empty().append($('<label>').text(label));
|
||||
},
|
||||
|
||||
innerHide: function() {
|
||||
this.call('close');
|
||||
},
|
||||
|
||||
innerDestroy: function() {
|
||||
/* tooltip destroys itself on hide */
|
||||
},
|
||||
|
||||
setPosition: function() {
|
||||
this.tip().position( $.extend({
|
||||
of: this.$element
|
||||
@ -102,11 +100,8 @@
|
||||
}
|
||||
|
||||
this.containerOptions.position = pos;
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
//jqueryui tooltip destroys itself
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}(window.jQuery));
|
Reference in New Issue
Block a user