rename containerDataName from uiTooltip to ui-tooltip, see

This commit is contained in:
vitalets
2013-08-07 11:27:54 +04:00
parent c936512e71
commit ca1a81e470
2 changed files with 20 additions and 12 deletions

@ -20,7 +20,8 @@ Applied as jQuery method.
//methods
Popup.prototype = {
containerName: null, //tbd in child class
containerName: null, //method to call container on element
containerDataName: null, //object name in element's .data()
innerCss: null, //tbd in child class
containerClass: 'editable-container editable-popup', //css class applied to container element
init: function(element, options) {
@ -121,7 +122,20 @@ Applied as jQuery method.
/* returns container object */
container: function() {
return this.$element.data(this.containerDataName || this.containerName);
var container;
//first, try get it by `containerDataName`
if(this.containerDataName) {
if(container = this.$element.data(this.containerDataName)) {
return container;
}
}
//second, try `containerName`
container = this.$element.data(this.containerName);
if(container) {
return container;
} else {
$.error('Can`t get container in element`s .data(). Container: ' + this.containerName);
}
},
/* call native method of underlying container, e.g. this.$element.popover('method') */