- Pull application name from template ID for image

- Use label as tooltip
- Apply CSS classes to image
This commit is contained in:
Nathan Gray
2011-08-31 16:00:45 +00:00
parent c5c90fbce0
commit 0dea78ab2e
3 changed files with 42 additions and 3 deletions

View File

@@ -745,6 +745,26 @@ var et2_widget = Class.extend({
return this._parent.getInstanceManager();
}
return null;
},
/**
* Returns the application for the template the widget is in.
* If a sub-template is used, this may be different from the current app.
*/
getTemplateApp: function() {
if(this._template_application)
{
return this._template_application;
}
else if(this._type == 'template' && this.id)
{
var parts = this.id.split(".",2);
return parts[0];
} else if (this.getParent()) {
this._template_application = this.getParent().getTemplateApp();
return this._template_application;
}
return null;
}
});