Sha256: 3c98c6b5cefd0b34bb8b34632346967ea64d22cbfd1fce929758ed6718fdab9d
Contents?: true
Size: 1.67 KB
Versions: 3
Compression:
Stored size: 1.67 KB
Contents
class Lanes.Component.PopOver extends Lanes.Component.Base events: 'hide.bs.popover': '_onHide' session: target: 'el' title: 'string' content: 'any' template: 'string' templateData: 'object' placement: { type: 'string', default: "right" } destroyAfterHide: [ 'boolean', true, false ] derived: options: deps: ['title','content','template','templateData'], fn:-> content = if this.template then this.renderTemplate() else this.content { title: @title, content: content, html: true, placement: "auto #{@placement}" } renderTemplate: -> template = Lanes.Templates.find(this.template) if template template(this.templateData) else Lanes.warn "PopOver Template #{this.template} was not found" initialize: (options)-> template = Lanes.Templates.find('component/popover')({ className: options.className||'' }) _.extend(options, this.options, {template: template, container: this.ui?.viewport}) this.target.popover(options).on("hide.bs.popover", _.bind(this._onHide, this) ) this.show() if options.autoShow toggleShown: (show)-> if show then this.show() else this.hide() show: -> this.target.popover('show') this.notification = new Lanes.Deferred return this.notification.promise destroy: -> this.target.popover('destroy') hide:-> this.target.popover('hide') Lanes.Promise.resolve( this ) this.destroy() _onHide: (ev)-> this.notification.resolve(this) this.destroy() if this.destroyAfterHide
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lanes-0.0.3 | client/javascripts/component/PopOver.coffee |
lanes-0.0.2 | client/javascripts/component/PopOver.coffee |
lanes-0.0.1 | client/javascripts/component/PopOver.coffee |