refactor containers: same render logic, fix tests

This commit is contained in:
vitalets
2013-01-11 17:07:00 +04:00
parent 775deede07
commit 0ced7f87f5
9 changed files with 230 additions and 137 deletions

@ -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));